jekyll-admin 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/lib/jekyll-admin/file_helper.rb +1 -6
  3. data/lib/jekyll-admin/public/asset-manifest.json +17 -17
  4. data/lib/jekyll-admin/public/index.html +1 -1
  5. data/lib/jekyll-admin/public/{precache-manifest.64226b0470ae7a98d28d6c8a80943541.js → precache-manifest.aff7726cf55090e9b1a563d77344218e.js} +13 -13
  6. data/lib/jekyll-admin/public/service-worker.js +1 -1
  7. data/lib/jekyll-admin/public/static/css/2.b74256fb.chunk.css +2 -0
  8. data/lib/jekyll-admin/public/static/css/2.b74256fb.chunk.css.map +1 -0
  9. data/lib/jekyll-admin/public/static/css/main.913a54c0.chunk.css +5 -0
  10. data/lib/jekyll-admin/public/static/css/main.913a54c0.chunk.css.map +1 -0
  11. data/lib/jekyll-admin/public/static/js/2.dc118925.chunk.js +3 -0
  12. data/lib/jekyll-admin/public/static/js/{2.c4e847cc.chunk.js.LICENSE.txt → 2.dc118925.chunk.js.LICENSE.txt} +1 -3
  13. data/lib/jekyll-admin/public/static/js/2.dc118925.chunk.js.map +1 -0
  14. data/lib/jekyll-admin/public/static/js/main.2e88166c.chunk.js +2 -0
  15. data/lib/jekyll-admin/public/static/js/main.2e88166c.chunk.js.map +1 -0
  16. data/lib/jekyll-admin/public/static/js/{runtime-main.e35fac22.js → runtime-main.95f94e60.js} +1 -1
  17. data/lib/jekyll-admin/public/static/js/{runtime-main.e35fac22.js.map → runtime-main.95f94e60.js.map} +1 -1
  18. data/lib/jekyll-admin/version.rb +1 -1
  19. metadata +36 -22
  20. data/lib/jekyll-admin/public/static/css/2.9311179f.chunk.css +0 -2
  21. data/lib/jekyll-admin/public/static/css/2.9311179f.chunk.css.map +0 -1
  22. data/lib/jekyll-admin/public/static/css/main.51bccafc.chunk.css +0 -5
  23. data/lib/jekyll-admin/public/static/css/main.51bccafc.chunk.css.map +0 -1
  24. data/lib/jekyll-admin/public/static/js/2.c4e847cc.chunk.js +0 -3
  25. data/lib/jekyll-admin/public/static/js/2.c4e847cc.chunk.js.map +0 -1
  26. data/lib/jekyll-admin/public/static/js/main.2ce220f0.chunk.js +0 -2
  27. data/lib/jekyll-admin/public/static/js/main.2ce220f0.chunk.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["utils/metadata.js","assets/images/logo-black-red.png","constants/api.js","ducks/notifications.js","utils/apiErrors.js","translations/en.js","translations/index.js","utils/fetch.js","utils/validation.js","ducks/utils.js","utils/helpers.js","ducks/config.js","constants/keyboardShortcuts.js","components/Splitter.js","components/Icon.js","components/Accordion.js","ducks/collections.js","containers/Sidebar.js","constants/index.js","containers/Header.js","containers/Notifications.js","containers/App.js","components/metadata/statics/StaticMetaSimple.js","components/metadata/statics/StaticMetaObjectItem.js","components/metadata/statics/StaticMetaObject.js","components/metadata/statics/StaticMetaArrayItem.js","components/metadata/statics/StaticMetaArray.js","components/metadata/StaticMetaButton.js","components/metadata/statics/StaticMetaField.js","components/FilePreview.js","components/Breadcrumbs.js","components/form/InputSearch.js","ducks/staticfiles.js","containers/views/StaticIndex.js","components/FilePicker.js","components/metadata/MetaTags.js","components/metadata/MetaSimple.js","components/metadata/MetaButtons.js","components/metadata/MetaObjectItem.js","components/metadata/MetaObject.js","components/metadata/MetaArrayItem.js","components/metadata/MetaArray.js","components/metadata/MetaField.js","ducks/metadata.js","ducks/siteMeta.js","containers/MetaFields.js","components/DataGUI.js","components/Editor.js","components/Errors.js","components/Button.js","containers/views/Configuration.js","components/Explorer.js","ducks/pages.js","containers/views/Pages.js","components/form/InputPath.js","components/form/InputTitle.js","utils/highlighter.js","components/MarkdownEditor.js","components/MarkdownPageBody.js","containers/views/PageEdit.js","components/CreateMarkdownPage.js","containers/views/PageNew.js","containers/views/Documents.js","containers/views/DocumentEdit.js","containers/views/DocumentNew.js","ducks/datafiles.js","containers/views/DataFiles.js","containers/views/DataFileEdit.js","containers/views/DataFileNew.js","ducks/drafts.js","containers/views/Drafts.js","containers/views/DraftEdit.js","containers/views/DraftNew.js","components/Dropzone.js","containers/views/StaticFiles.js","containers/views/NotFound.js","routes.js","ducks/index.js","store.js","index.js"],"names":["addFieldToMetadata","state","namePrefix","tmpState","cloneDeep","field","eval","undefined","_","isArray","push","new_field_count","metadata","removeFieldFromMetadata","key","length","splice","has","updateMetadataFieldKey","fieldKey","newKey","Object","keys","reduce","result","current","updateMetadataFieldValue","nameAttr","value","convertMetadataField","convertType","moveMetadataArrayItem","srcInd","targetInd","arr","injectDefaultFields","config","path","type","defaults","front_matter","content","e","metafields","each","scope","extend","values","computeFieldType","specialKeys","includes","isObject","module","exports","API","putConfigurationUrl","pagesAPIUrl","directory","pageAPIUrl","filename","draftsAPIUrl","draftAPIUrl","collectionAPIUrl","collection_name","documentAPIUrl","datafilesAPIUrl","datafileAPIUrl","staticfilesAPIUrl","staticfileAPIUrl","addNotification","title","message","level","notification","BadInputError","name","stack","Error","getDeleteMessage","getLeaveMessage","getNotFoundMessage","getOverrideMessage","getParserErrorMessage","getSuccessMessage","getErrorMessage","getUploadSuccessMessage","getUploadErrorMessage","getFetchErrorMessage","getUpdateErrorMessage","getDeleteErrorMessage","getPublishDraftMessage","draftPath","postPath","getTitleRequiredMessage","getFilenameRequiredMessage","getContentRequiredMessage","getFilenameNotValidMessage","sidebar","pages","posts","drafts","datafiles","collections","staticfiles","configuration","labels","save","label","triggeredLabel","create","delete","publish","view","upload","viewToggle","translations","en","get","url","action_success","action_failure","dispatch","fetch","credentials","then","res","json","data","catch","error","put","body","method","error_message","del","id","DATE_FILENAME_MATCHER","FILENAME_MATCHER","validatePage","validator","validations","messages","errorMessages","validationStr","list","validationArr","split","single","test","validated","filterBySearchInput","input","filter","p","toLowerCase","filterDeleted","item","relative_path","search","clearErrors","validationError","errors","toYAML","obj","isEmpty","yaml","safeDump","indent","capitalize","string","charAt","toUpperCase","substring","toTitleCase","replace","txt","substr","slugify","a","RegExp","join","toString","c","indexOf","getFilenameFromPath","lastIndexOf","getExtensionFromPath","index","preventDefault","event","trimObject","object","acc","trim","JSON","parse","Array","getDocumentTitle","splat","prefix","Boolean","computeRelativePath","sanitizeFrontMatter","omit","preparePayload","stringify","fetchConfig","putConfig","source","getState","payload","raw_content","validateConfig","onEditorChange","Splitter","className","Icon","aria-hidden","Accordion","collapsed","handleClick","setState","this","props","counter","count","icon","minHeight","children","accordionClasses","classnames","panelHeight","style","maxHeight","onClick","renderIndicator","Component","defaultProps","fetchCollections","fetchCollection","collection","fetchDocument","createDocument","date","validateDocument","generateFilenameFromTitle","putDocument","deleteDocument","slugifiedTitle","docDate","moment","format","SidebarTranslations","Sidebar","hiddens","collectionItems","map","col","i","activeClassName","to","sidebar_label","itemsCount","hiddenLinks","link","translation","splitterBefore","defaultLinks","jekyll_admin","hidden_links","visibleLinks","difference","links","collectionsPanel","renderCollections","postsPanel","draftsPanel","show_drafts","connect","bindActionCreators","Header","target","process","Notifications","elementStyles","Containers","DefaultStyle","padding","width","textAlign","Title","fontSize","color","NotificationItem","margin","borderRadius","transition","success","backgroundColor","warning","info","Dismiss","top","right","height","border","opacity","notificationSystem","refs","nextProps","position","autoDismiss","ref","notifications","App","updated","prevProps","isFetching","homepage","router","currentPathname","getCurrentLocation","pathname","concat","keyMap","keyboardShortcuts","StaticMetaSimple","fieldValue","disabled","FieldTypes","array","StaticMetaArray","StaticMetaObject","simple","StaticMetaObjectItem","CurrentComponent","items","StaticMetaArrayItem","StaticMetaButton","dropdown","toggleDropdownState","onEnableField","dropdownClasses","tabIndex","onBlur","onMouseDown","StaticMetaField","enableField","FilePreview","onClickDelete","window","confirm","file","from_theme","handleClickDelete","node","isImageFile","src","http_url","alt","nodeLink","href","rel","renderFileOverlay","extname","Breadcrumbs","base","nodes","paths","before","slice","InputSearch","handleKeyPress","searchBy","onKeyPress","placeholder","fetchStaticFiles","uploadStaticFiles","files","reader","FileReader","readAsDataURL","onloadend","encoded_content","deleteStaticFile","filterByFilename","f","StaticIndex","onClickStaticFile","modalView","renderDirectoryListingBtn","renderPreviewNode","utils","FilePicker","showModal","customStyles","overlay","zIndex","paddingTop","paddingRight","paddingLeft","openModal","shutModal","onPickItem","onPick","isOpen","contentLabel","onRequestClose","MetaTags","creators","handleKeyUp","pageTags","createTag","deleteTag","handleOnChange","tagInput","showSuggestions","autoSuggest","closeSuggestions","rectifyTag","tag","rectified","updateFieldValue","clone","tagName","pop","taginput","focus","suggestions","entry","startsWith","tags","suggests","suggestionClasses","visible","onChange","onFocus","onKeyUp","hidden","momentLocalizer","MetaSimple","handleEditableChange","handleDatepickerChange","dateStr","handleEditableBlur","imagepicker","handleLayoutChange","dateValue","Date","siteMeta","renderEditable","layouts","defaultValue","renderDatepicker","renderStaticFilePicker","renderTagsInput","renderLayoutPicker","MetaButtons","fieldTypes","fieldTypeKeys","onConvertClick","parentKey","ftype","currentType","parentType","onRemoveClick","isDefaultField","sortableHandle","renderDropdownItems","MetaObjectItem","convertField","updateFieldKey","currentValue","findDOMNode","field_key","removeField","addField","key_prefix","moveArrayItem","MetaArray","MetaObject","handleKeyBlur","handleConvertClick","handleRemoveClick","MetaArrayItem","data-id","component","options","draggable","group","pull","handle","animation","onEnd","getAttribute","newIndex","Sortable","sortableGroupDecorator","bind","MetaField","select","isInDefaultState","storeContentFields","updateTitle","updateBody","updatePath","fetchSiteMeta","MetaFields","fields","dataview","isEqual","site","staticFields","visibleKeys","metafieldsClass","datafields","defaultFieldsNotOverwritten","hasOwnProperty","newWrapper","meta","DataGUI","handleChange","slug","ext","restricted","renderPathFields","Editor","editorChanged","nextState","ace","editor","getValue","mode","theme","showGutter","showPrintMargin","highlightActiveLine","scrollMargin","Errors","iconMap","Button","active","triggered","block","thin","btnClass","iconName","iconNode","Configuration","guiView","routerWillLeave","nextLocation","fieldChanged","toggleView","handleClickSave","route","setRouteLeaveHook","keyboardHandlers","handlers","renderContentBody","withRouter","Explorer","deleteItem","params","dir","browserHistory","renderTitleCell","renderDirectoryRow","renderFileRow","newBtnLabel","typeLabel","renderRows","fetchPages","fetchPage","createPage","putPage","deletePage","Pages","InputFilename","tooltip","InputTitle","hljs","registerLanguage","require","classNames","MarkdownEditor","_replaceSelectedText","cm","headNTail","startPoint","getCursor","endPoint","text","getSelection","head","tail","replaceSelection","ch","setSelection","handleFilePick","codemirror","insertTexts","image","initialValue","destroy","onSave","opts","codeSyntaxHighlighting","toolbarIcons","action","filepicker","trigger","click","SimpleMDE","on","elementToRemove","container","querySelector","remove","display","MarkdownPageBody","staticmetafields","PageEdit","new_path","page","front_matter_defaults","document_title","CreateMarkdownPage","onClickSave","metaType","defaultFields","PageNew","Documents","doc","modified_time","documents","renderTable","entries","DocumentEdit","currentDocument","DocumentNew","fetchDataFiles","fetchDataFile","putDataFile","validateDatafile","deleteDataFile","onDataFileChanged","DataFiles","DataFileEdit","datafileChanged","datafile","data_dir","gui","filepath","inputpath","data_path","guiSupport","renderAside","currentFile","DataFileNew","fetchDrafts","fetchDraft","createDraft","putDraft","deleteDraft","publishDraft","Drafts","DraftEdit","draft","today","datedfilename","goTo","handleClickPublish","DraftNew","Dropzone","ReactDropzone","open","onDrop","onClickItem","multiple","disableClick","StaticFiles","openDropzone","dropzone","uploadedFiles","existingFiles","currentFiles","currentFilenames","cf","chain","existingUploadedFilenames","static_files","dirs","entity","renderFilePreviewRow","NotFound","combineReducers","routing","routerReducer","Math","random","uploading","configureStore","createLogger","initialState","middlewares","thunk","createStore","rootReducer","compose","applyMiddleware","store","history","syncHistoryWithStore","render","routes","from","document","getElementById"],"mappings":"q5CAUaA,mBAAqB,SAArBA,mBAAsBC,MAAOC,YACxC,IAAIC,SAAWC,wDAAUH,OACrBI,MAAQC,KAAK,YAAD,OAAaJ,aAC7B,YAAcK,IAAVF,QACAG,kDAAEC,QAAQJ,OAAQA,MAAMK,KAAK,IAC5BL,MAAM,aAAD,OAAcJ,MAAMU,kBAAqB,IAFnBR,SAASS,UAc9BC,wBAA0B,SAA1BA,wBAA2BZ,MAAOC,WAAYY,KACzD,IAA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B,EADL,CAEE4rB,WAAW,IAEf,IApGqC,4BAqGnC,OAAO,eACF5rB,EADL,CAEEyX,MAAO/N,GAAc1J,EAAMyX,MAAOuO,EAAO1d,MAE7C,QACE,OAAOtI,I6C5GXuY,MpESa,WAMZ,IALDvY,EAKA,uDALQ,CACNsJ,MAAO,GACPU,OAAQ,IAEVgc,EACA,uCACA,OAAQA,EAAO3jB,MACb,IA5B0B,iBA6BxB,OAAO,eACFrC,EADL,CAEEsJ,MAAO0c,EAAO1c,QAElB,IAhCwB,eAiCtB,OAAO,eACFtJ,EADL,CAEEgK,OAAQ,KAEZ,IApC4B,mBAqC1B,OAAO,eACFhK,EADL,CAEEgK,OAAQgc,EAAOhc,SAEnB,QACE,OAAO,eACFhK,EADL,CAEEsJ,MAAO,OoElCbkK,c1EXa,WAKZ,IAJDxT,EAIA,uDAJQ,CACNwE,aAAc,IAEhBwhB,EACA,uCACA,OAAQA,EAAO3jB,MACb,IApB4B,mBAqB1B,OAAO,eACFrC,EADL,CAEEwE,aAAcwhB,EAAOxhB,eAEzB,QACE,OAAOxE,M2EiBE6rB,IAtCAC,OAEY,SAAAC,GACzB,IAAMC,EAAc,CAACC,MAErB,OAAOC,YACLC,GACAJ,EACAK,YAAQC,IAAe,WAAf,EAAmBL,OCHzBM,I,OAAQT,MACRU,GAAUC,+BAAqBpJ,iBAAgBkJ,IAErDG,iBACE,kBAAC,IAAD,CAAUH,MAAOA,IACf,kBAAC,SAAD,CAAQC,QAASA,GAASG,OAAQA,IAChC,kBAAC,WAAD,CAAUC,KAAI,U7DjBQ,S6DiBR,KAAsBxc,GAAE,U7DjBhB,S6DiBgB,eAG1Cyc,SAASC,eAAe,W","file":"static/js/main.2e88166c.chunk.js","sourcesContent":["import _ from 'underscore';\nimport cloneDeep from 'lodash/cloneDeep';\n\n/**\n * Returns the metadata of the state with the new empty field. If the field does\n * not exist, returns the original metadata. Does not mutate the given state.\n * @param {Object} state\n * @param {String} namePrefix\n * @return {Object} metadata\n */\nexport const addFieldToMetadata = (state, namePrefix) => {\n let tmpState = cloneDeep(state);\n let field = eval(`tmpState.${namePrefix}`);\n if (field === undefined) return tmpState.metadata;\n if (_.isArray(field)) field.push('');\n else field[`New field ${state.new_field_count}`] = '';\n return tmpState.metadata;\n};\n\n/**\n * Returns the metadata of the state with the removed key. If the field does not\n * exist, returns the original metadata. Does not mutate the given state.\n * @param {Object} state\n * @param {String} namePrefix\n * @param {String} key\n * @return {Object} metadata\n */\nexport const removeFieldFromMetadata = (state, namePrefix, key) => {\n let tmpState = cloneDeep(state);\n let field = eval(`tmpState.${namePrefix}`);\n if (field === undefined) return tmpState.metadata;\n if (_.isArray(field)) {\n if (key >= field.length) {\n return tmpState.metadata;\n }\n field.splice(key, 1);\n } else {\n if (!_.has(field, key)) {\n return tmpState.metadata;\n }\n delete field[key];\n }\n return tmpState.metadata;\n};\n\n/**\n * Returns the metadata of the state with the updated key. If the field does not\n * exist or the key already exists, returns the original metadata. Does not\n * mutate the given state.\n * @param {Object} state\n * @param {String} namePrefix\n * @param {String} fieldKey\n * @param {String} newKey\n * @return {Object} metadata\n */\nexport const updateMetadataFieldKey = (state, namePrefix, fieldKey, newKey) => {\n let tmpState = cloneDeep(state);\n let field = eval(`tmpState.${namePrefix}`);\n if (field === undefined) return tmpState.metadata;\n if (_.has(field, newKey)) return tmpState.metadata;\n field = Object.keys(field).reduce((result, current) => {\n if (current === fieldKey) result[newKey] = field[current];\n else result[current] = field[current];\n return result;\n }, {});\n eval(`tmpState.${namePrefix} = field`);\n return tmpState.metadata;\n};\n\n/**\n * Returns the metadata of the state with the updated value of given path(nameAttr).\n * If the field does not exist, creates a new field. Does not mutate the given state.\n * @param {Object} state\n * @param {String} nameAttr\n * @param {String} value\n * @return {Object} metadata\n */\nexport const updateMetadataFieldValue = (state, nameAttr, value) => {\n let tmpState = cloneDeep(state);\n eval(`tmpState.${nameAttr} = value`);\n return tmpState.metadata;\n};\n\n/**\n * Returns the metadata of the state with the converted type of given path(nameAttr).\n * If the field does not exist, returns the original metadata.\n * Does not mutate the given state.\n * @param {Object} state\n * @param {String} nameAttr\n * @param {String} convertType\n * @return {Object} metadata\n */\nexport const convertMetadataField = (state, nameAttr, convertType) => {\n let tmpState = cloneDeep(state);\n let field = eval(`tmpState.${nameAttr}`);\n if (field === undefined) return tmpState.metadata;\n if (convertType === 'array') field = [''];\n else if (convertType === 'object') {\n let key = `New field ${state.new_field_count}`;\n field = { [key]: '' };\n } else field = '';\n eval(`tmpState.${nameAttr} = field`);\n return tmpState.metadata;\n};\n\n/**\n * Returns the metadata of the state with the sorted array. Moves the array item to\n * target index, shifts the rest of them. If the given path is not an array,\n * returns the original metadata. Does not mutate the given state.\n * @param {Object} state\n * @param {String} namePrefix\n * @param {Number} srcInd\n * @param {Number} targetInd\n * @return {Object} metadata\n */\nexport const moveMetadataArrayItem = (state, namePrefix, srcInd, targetInd) => {\n let tmpState = cloneDeep(state);\n let arr = eval(`tmpState.${namePrefix}`);\n if (!_.isArray(arr)) return tmpState.metadata;\n arr.splice(targetInd, 0, arr.splice(srcInd, 1)[0]);\n return tmpState.metadata;\n};\n\n/**\n * Injects the relevant default front matter fields read from the config file into\n * the provided front matter object\n * @param {Object} config\n * @param {String} path\n * @param {String} type\n * @param {Object} front_matter\n * @return {Object} metadata\n */\nexport const injectDefaultFields = (config, path, type, front_matter = {}) => {\n let defaults;\n try {\n defaults = config.content.defaults;\n } catch (e) {\n return {};\n }\n let metafields = {};\n _.each(defaults, field => {\n const scope = field.scope;\n if (\n (!scope.type || scope.type === type) &&\n (!scope.path || scope.path === path)\n ) {\n _.extend(metafields, field.values);\n }\n });\n return _.extend(metafields, front_matter);\n};\n\n/**\n * Given a field-value and corresponding key, this utility returns\n * metadata type for the pair.\n * @param {*} value\n * @param {String} key\n * @return {String} type\n */\nexport const computeFieldType = (value, key = null) => {\n let type = 'simple';\n const specialKeys = ['tags', 'categories'];\n if (specialKeys.includes(key) && _.isArray(value)) return type;\n\n if (_.isObject(value)) type = 'object';\n if (_.isArray(value)) type = 'array';\n return type;\n};\n","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAB5CAYAAACDSRyFAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9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RNewOSZBquClnr1g7Pwry85UpkNE3TtEuwCZKkFEPRE0/jBXyKmRDDLOwDTdO0rFQPL6IEYmkBumObpGmaVoCL0BujsQTrsBYL8DtewXHI+/4ftS4BbH1NbcMAAAAASUVORK5CYII=\"","export const API =\n process.env.NODE_ENV === 'production'\n ? '/_api'\n : 'http://localhost:4000/_api';\n\nexport const getSiteMetaUrl = () => `${API}/site_meta`;\n\nexport const getConfigurationUrl = () => `${API}/configuration`;\nexport const putConfigurationUrl = () => `${API}/configuration`;\n\nexport const pagesAPIUrl = (directory = '') => `${API}/pages/${directory}`;\nexport const pageAPIUrl = (directory, filename) =>\n directory\n ? `${API}/pages/${directory}/${filename}`\n : `${API}/pages/${filename}`;\n\nexport const draftsAPIUrl = (directory = '') => `${API}/drafts/${directory}`;\nexport const draftAPIUrl = (directory, filename) =>\n directory\n ? `${API}/drafts/${directory}/${filename}`\n : `${API}/drafts/${filename}`;\n\nexport const collectionsAPIUrl = () => `${API}/collections`;\nexport const collectionAPIUrl = (collection_name, directory) =>\n directory\n ? `${API}/collections/${collection_name}/entries/${directory}`\n : `${API}/collections/${collection_name}/entries`;\nexport const documentAPIUrl = (collection_name, directory, filename) =>\n directory\n ? `${API}/collections/${collection_name}/${directory}/${filename}`\n : `${API}/collections/${collection_name}/${filename}`;\n\nexport const datafilesAPIUrl = (directory = '') => `${API}/data/${directory}`;\nexport const datafileAPIUrl = (directory, filename) =>\n directory\n ? `${API}/data/${directory}/${filename}`\n : `${API}/data/${filename}`;\n\nexport const staticfilesAPIUrl = (directory = '') =>\n `${API}/static_files/${directory}`;\nexport const staticfileAPIUrl = (directory, filename) =>\n directory\n ? `${API}/static_files/${directory}/${filename}`\n : `${API}/static_files/${filename}`;\n","// Action Types\nexport const ADD_NOTIFICATION = 'ADD_NOTIFICATION';\n\n// Actions\nexport const addNotification = (title, message, level) => ({\n type: ADD_NOTIFICATION,\n notification: {\n title,\n message,\n level,\n },\n});\n\n// Reducer\nexport default function notifications(\n state = {\n notification: {},\n },\n action\n) {\n switch (action.type) {\n case ADD_NOTIFICATION:\n return {\n ...state,\n notification: action.notification,\n };\n default:\n return state;\n }\n}\n","export class BadInputError extends Error {\n constructor(message) {\n super();\n this.name = 'BadInputError';\n this.message = message || 'Bad input';\n this.stack = new Error().stack;\n }\n}\n","// inline messages\nexport const getDeleteMessage = filename =>\n `Are you sure that you want to delete \"${filename}\" ?`;\n\nexport const getLeaveMessage = () =>\n 'You have unsaved changes on this page. Are you sure you want to leave?';\n\nexport const getNotFoundMessage = type => `No ${type} found.`;\n\nexport const getOverrideMessage = filename =>\n `${filename} will be overwritten. Continue anyway?`;\n\n// notification messages\nexport const getParserErrorMessage = () => 'Parse Error';\n\nexport const getSuccessMessage = () => 'Success';\n\nexport const getErrorMessage = () => 'Error';\n\nexport const getUploadSuccessMessage = filename =>\n `${filename} uploaded successfully`;\n\nexport const getUploadErrorMessage = () => `Error occurred uploading the file.`;\n\nexport const getFetchErrorMessage = filename =>\n `Could not fetch the ${filename}`;\n\nexport const getUpdateErrorMessage = filename =>\n `Could not update the ${filename}`;\n\nexport const getDeleteErrorMessage = filename =>\n `Could not delete the ${filename}`;\n\nexport const getPublishDraftMessage = (draftPath, postPath) =>\n `'${draftPath}' will be converted to '${postPath}'`;\n\n// validation messages\nexport const getTitleRequiredMessage = () => 'The title is required.';\n\nexport const getFilenameRequiredMessage = () => 'The filename is required.';\n\nexport const getContentRequiredMessage = () => 'The content is required.';\n\nexport const getFilenameNotValidMessage = () => 'The filename is not valid.';\n\n// sidebar titles\nexport const sidebar = {\n pages: 'Pages',\n posts: 'Posts',\n drafts: 'Drafts',\n datafiles: 'Data Files',\n collections: 'Collections',\n staticfiles: 'Static Files',\n configuration: 'Configuration',\n};\n\n// button labels\nexport const labels = {\n save: {\n label: 'Save',\n triggeredLabel: 'Saved',\n },\n create: {\n label: 'Create',\n triggeredLabel: 'Created',\n },\n delete: {\n label: 'Delete',\n },\n publish: {\n label: 'Publish',\n },\n view: {\n label: 'View',\n },\n upload: {\n label: 'Upload files',\n },\n viewToggle: {\n label: 'Switch View to GUI Editor',\n triggeredLabel: 'Switch View to Raw Editor',\n },\n};\n","// TODO:\n// -------------------------------\n// import * as da from './da';\n// import * as es from './es';\n// import * as fr from './fr';\n// import * as ptBr from './ptBr';\n// import * as sv from './sv';\n\nimport * as en from './en';\n\nconst translations = en; // TODO: select language\nexport default translations;\n","import fetch from 'isomorphic-fetch';\nimport { addNotification } from '../ducks/notifications';\nimport { BadInputError } from './apiErrors';\n\nimport translations from '../translations';\nconst {\n getErrorMessage,\n getFetchErrorMessage,\n getUpdateErrorMessage,\n getDeleteErrorMessage,\n} = translations;\n\n/**\n * Fetch wrapper for GET request that dispatches actions according to the\n * request status\n * @param {String} url\n * @param {Object} action_success\n * @param {Object} action_failure\n * @return {Function} dispatch\n */\nexport const get = (url, action_success, action_failure, dispatch) => {\n return fetch(url, { credentials: 'same-origin' })\n .then(res => res.json())\n .then(data =>\n dispatch({\n type: action_success.type,\n [action_success.name]: data,\n })\n )\n .catch(error => {\n dispatch({\n type: action_failure.type,\n [action_failure.name]: error,\n });\n dispatch(\n addNotification(\n getErrorMessage(),\n getFetchErrorMessage(action_success.name),\n 'error'\n )\n );\n });\n};\n\n/**\n * Fetch wrapper for PUT request that dispatches actions according to the\n * request status\n * @param {String} url\n * @param {Object} body\n * @param {Object} action_success\n * @param {Object} action_failure\n * @return {Function} dispatch\n */\nexport const put = (url, body, action_success, action_failure, dispatch) => {\n return fetch(url, {\n method: 'PUT',\n credentials: 'same-origin',\n body,\n })\n .then(res => res.json())\n .then(data => {\n if (data.error_message) {\n throw new BadInputError(data.error_message);\n }\n dispatch({\n type: action_success.type,\n [action_success.name]: data,\n });\n })\n .catch(error => {\n dispatch({\n type: action_failure.type,\n [action_failure.name]: error,\n });\n let error_message =\n error.name === 'BadInputError'\n ? error.message\n : getUpdateErrorMessage(action_success.name);\n dispatch(addNotification(getErrorMessage(), error_message, 'error'));\n });\n};\n\n/**\n * Fetch wrapper for DELETE request that dispatches actions according to the\n * request status\n * @param {String} url\n * @param {Object} action_success\n * @param {Object} action_failure\n * @return {Function} dispatch\n */\nexport const del = (url, action_success, action_failure, dispatch) => {\n return fetch(url, {\n method: 'DELETE',\n credentials: 'same-origin',\n })\n .then(data =>\n dispatch({\n type: action_success.type,\n id: action_success.id,\n })\n )\n .catch(error => {\n dispatch({\n type: action_failure.type,\n [action_failure.name]: error,\n });\n dispatch(\n addNotification(\n getErrorMessage(),\n getDeleteErrorMessage(action_success.name),\n 'error'\n )\n );\n });\n};\n","import _ from 'underscore';\n\nimport translations from '../translations';\nconst { getTitleRequiredMessage, getFilenameNotValidMessage } = translations;\n\nconst DATE_FILENAME_MATCHER = /^(?:.+\\/)*(\\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1]))-(.*)(\\.[^.]+)$/;\nconst FILENAME_MATCHER = /^(.*)(\\.[^.]+)$/;\n\nconst validated = (field, single) => {\n switch (single) {\n case 'required':\n return !!field;\n case 'date':\n return DATE_FILENAME_MATCHER.test(field);\n case 'filename':\n return FILENAME_MATCHER.test(field);\n default:\n return false;\n }\n};\n\nexport const validatePage = metadata => {\n return validator(\n metadata,\n { path: 'required|filename' },\n {\n 'path.required': getTitleRequiredMessage(),\n 'path.filename': getFilenameNotValidMessage(),\n }\n );\n};\n\n/**\n * Returns error messages if the given values does not pass the provided validations.\n * @param {Object} values\n * @param {Object} validations\n * @param {Object} messages\n * @return {Array} errorMessages\n */\nexport const validator = (values, validations, messages) => {\n let errorMessages = [];\n _.each(validations, (validationStr, field, list) => {\n const validationArr = validationStr.split('|');\n _.each(validationArr, single => {\n if (!validated(values[field], single)) {\n errorMessages.push(messages[`${field}.${single}`]);\n }\n });\n });\n return errorMessages;\n};\n","// Selectors\nexport const filterBySearchInput = (list, input) => {\n if (!input) {\n return list;\n }\n return list.filter(p => p.name.toLowerCase().includes(input.toLowerCase()));\n};\n\nexport const filterDeleted = (list, id) => {\n return list.filter(item => item.relative_path !== id);\n};\n\n// Action Types\nexport const SEARCH_CONTENT = 'SEARCH_CONTENT';\nexport const CLEAR_ERRORS = 'CLEAR_ERRORS';\nexport const VALIDATION_ERROR = 'VALIDATION_ERROR';\n\n// Actions\nexport const search = input => ({\n type: SEARCH_CONTENT,\n input,\n});\n\nexport const clearErrors = () => ({\n type: CLEAR_ERRORS,\n});\n\nexport const validationError = errors => ({\n type: VALIDATION_ERROR,\n errors,\n});\n\n// Reducer\nexport default function utils(\n state = {\n input: '',\n errors: [],\n },\n action\n) {\n switch (action.type) {\n case SEARCH_CONTENT:\n return {\n ...state,\n input: action.input,\n };\n case CLEAR_ERRORS:\n return {\n ...state,\n errors: [],\n };\n case VALIDATION_ERROR:\n return {\n ...state,\n errors: action.errors,\n };\n default:\n return {\n ...state,\n input: '',\n };\n }\n}\n","import yaml from 'js-yaml';\nimport _ from 'underscore';\n\n/**\n * Converts the object into YAML string.\n * @param {Object} object\n * @return {String} yaml\n */\nexport const toYAML = obj =>\n !_.isEmpty(obj) ? yaml.safeDump(obj, { indent: 2 }) : '';\n\n/**\n * Converts the YAML string into JS object.\n * @param {String} string\n * @return {Object} obj\n */\nexport const toJSON = yamlString => (yamlString ? yaml.load(yamlString) : {});\n\n/**\n * Capitalize the given string.\n * @param {String} string\n * @return {String} string\n */\nexport const capitalize = string => {\n if (!string) return '';\n return string.charAt(0).toUpperCase() + string.substring(1).toLowerCase();\n};\n\n/**\n * Convert the given string into title case format.\n * @param {String} string\n * @return {String} string\n */\nexport const toTitleCase = string => {\n if (!string) return '';\n return string.replace(/\\w\\S*/g, txt => {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n};\n\n/**\n * Slugify the given string\n * @param {String} string\n * @return {String} string\n */\nexport const slugify = string => {\n if (!string) return '';\n const a = 'àáäâèéëêìíïîıòóöôùúüûñçşßÿœæŕśńṕẃǵğǹḿǘẍźḧ·/_,:;';\n const b = 'aaaaeeeeiiiiioooouuuuncssyoarsnpwggnmuxzh------';\n const p = new RegExp(a.split('').join('|'), 'g');\n\n return string\n .toString()\n .toLowerCase()\n .replace(/\\s+/g, '-') // Replace spaces with -\n .replace(p, c => b.charAt(a.indexOf(c))) // Replace special chars\n .replace(/&/g, '-') // Replace & with 'and'\n .replace(/[^\\w-]+/g, '') // Remove all non-word chars\n .replace(/-+/g, '-') // Replace multiple - with single -\n .replace(/^-+/, '') // Trim - from start of text\n .replace(/-+$/, ''); // Trim - from end of text\n};\n\n/**\n * Returns filename from the given path\n * @param {String} path\n * @return {String} filename\n */\nexport const getFilenameFromPath = path => {\n if (!path) return '';\n return path.substring(path.lastIndexOf('/') + 1);\n};\n\n/**\n * Returns extension from the given path or filename\n * @param {String} path or filename\n * @return {String} extension or nil\n */\nexport const getExtensionFromPath = path => {\n if (!path) return '';\n const filename = getFilenameFromPath(path);\n const index = filename.lastIndexOf('.');\n\n if (index > 0) {\n return filename.substring(index + 1);\n } else {\n return '';\n }\n};\n\n/**\n * returns the uploaded static files that are being overwritten\n * @param {Array} uploadedFiles\n * @param {Array} currentFiles\n * @return {Array} filenames\n */\nexport const existingUploadedFilenames = (uploadedFiles, currentFiles) => {\n if (\n (uploadedFiles && !uploadedFiles.length) ||\n (currentFiles && !currentFiles.length)\n ) {\n return [];\n }\n const currentFilenames = _.map(currentFiles, cf =>\n getFilenameFromPath(cf.path)\n );\n return _.chain(uploadedFiles)\n .filter(file => currentFilenames.includes(file.name))\n .map(file => file.name)\n .value();\n};\n\n/**\n * Given an Event object, prevents the default event\n * from bubbling, if possible.\n * @param {Event} event\n */\nexport const preventDefault = event => {\n if (event && event.preventDefault) {\n event.preventDefault();\n }\n};\n\n/**\n * Given an object, trims every keys and values recursively.\n * @param {Object} object\n * @return {Object} trimmedObject\n */\nexport const trimObject = object => {\n if (!_.isObject(object)) return object;\n return _.keys(object).reduce((acc, key) => {\n if (typeof object[key] === 'string') {\n try {\n acc[key.trim()] = JSON.parse(object[key].trim());\n } catch (e) {\n acc[key.trim()] = object[key].trim();\n }\n } else {\n acc[key.trim()] = trimObject(object[key]);\n }\n return acc;\n }, Array.isArray(object) ? [] : {});\n};\n\n/**\n * Given a resource type and splat, returns a formatted title string.\n * Falsy values are discarded.\n * @param {String} type - Resource type.\n * @param {String} splat - Directory splat for current resource.\n * @param {String} [prefix=''] - Optional string text to be placed in front.\n * @return {String} Empty string or formatted title.\n */\nexport const getDocumentTitle = (type, splat, prefix = '') => {\n if (!type) return '';\n const label = toTitleCase(type.toString());\n return [prefix, splat, label].filter(Boolean).join(' | ');\n};\n\n/**\n * @param {String} directory - Directory splat for current resource.\n * @param {String} filename - Basename of current resource.\n * @return {String} Filename or directory splat joined to the filename.\n */\nexport const computeRelativePath = (directory, filename) => {\n return directory ? `${directory}/${filename}` : `${filename}`;\n};\n\n// omit raw_content, path and empty-value keys in metadata state from front_matter\nexport const sanitizeFrontMatter = metadata => {\n return _.omit(metadata, (value, key, object) => {\n return key === 'raw_content' || key === 'path' || value === '';\n });\n};\n\nexport const preparePayload = obj => JSON.stringify(trimObject(obj));\nexport const getFilenameFromTitle = title => `${slugify(title)}.md`;\n","import { getConfigurationUrl, putConfigurationUrl } from '../constants/api';\nimport { get, put } from '../utils/fetch';\nimport { validator } from '../utils/validation';\nimport { clearErrors, validationError } from './utils';\nimport { toYAML } from '../utils/helpers';\n\nimport translations from '../translations';\nconst { getContentRequiredMessage } = translations;\n\n// Action Types\nexport const FETCH_CONFIG_REQUEST = 'FETCH_CONFIG_REQUEST';\nexport const FETCH_CONFIG_SUCCESS = 'FETCH_CONFIG_SUCCESS';\nexport const FETCH_CONFIG_FAILURE = 'FETCH_CONFIG_FAILURE';\nexport const PUT_CONFIG_REQUEST = 'PUT_CONFIG_REQUEST';\nexport const PUT_CONFIG_SUCCESS = 'PUT_CONFIG_SUCCESS';\nexport const PUT_CONFIG_FAILURE = 'PUT_CONFIG_FAILURE';\nexport const CONFIG_EDITOR_CHANGED = 'CONFIG_EDITOR_CHANGED';\n\n// Actions\nexport const fetchConfig = () => dispatch => {\n dispatch({ type: FETCH_CONFIG_REQUEST });\n return get(\n getConfigurationUrl(),\n { type: FETCH_CONFIG_SUCCESS, name: 'config' },\n { type: FETCH_CONFIG_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const putConfig = (config, source = 'editor') => (\n dispatch,\n getState\n) => {\n let payload;\n\n if (source === 'gui') {\n config = getState().metadata.metadata;\n payload = { raw_content: toYAML(config) };\n } else {\n payload = { raw_content: config };\n }\n\n // handle errors\n const errors = validateConfig(config);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n dispatch(clearErrors());\n\n return put(\n putConfigurationUrl(),\n JSON.stringify(payload),\n { type: PUT_CONFIG_SUCCESS, name: 'config' },\n { type: PUT_CONFIG_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nconst validateConfig = config =>\n validator(\n { config },\n { config: 'required' },\n {\n 'config.required': getContentRequiredMessage(),\n }\n );\n\nexport const onEditorChange = () => ({\n type: CONFIG_EDITOR_CHANGED,\n});\n\n// Reducer\nexport default function config(\n state = {\n config: {},\n updated: false,\n editorChanged: false,\n fieldChanged: false,\n isFetching: false,\n },\n action\n) {\n switch (action.type) {\n case FETCH_CONFIG_REQUEST:\n return {\n ...state,\n isFetching: true,\n };\n case FETCH_CONFIG_SUCCESS:\n return {\n ...state,\n config: action.config,\n isFetching: false,\n };\n case FETCH_CONFIG_FAILURE:\n return {\n ...state,\n isFetching: false,\n };\n case PUT_CONFIG_SUCCESS:\n return {\n ...state,\n config: action.config,\n editorChanged: false,\n updated: true,\n };\n case PUT_CONFIG_FAILURE:\n return {\n ...state,\n editorChanged: false,\n };\n case CONFIG_EDITOR_CHANGED:\n return {\n ...state,\n editorChanged: true,\n updated: false,\n };\n default:\n return {\n ...state,\n updated: false,\n editorChanged: false,\n };\n }\n}\n","export default {\n save: 'mod+s',\n};\n","import React from 'react';\n\nconst Splitter = () => <div className=\"splitter\" />;\n\nexport default Splitter;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nexport default function Icon({ name }) {\n return <i className={`fa fa-${name}`} aria-hidden=\"true\" />;\n}\n\nIcon.propTypes = {\n name: PropTypes.string.isRequired,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Icon from './Icon';\n\nclass Accordion extends Component {\n state = { collapsed: true };\n\n handleClick = () => {\n this.setState(state => {\n return {\n collapsed: !state.collapsed,\n };\n });\n };\n\n renderIndicator() {\n const { counter, count } = this.props;\n const { collapsed } = this.state;\n\n if (collapsed && counter && count) {\n return <div className=\"counter\">{count}</div>;\n }\n return (\n <div className=\"chevrons\">\n <Icon name={`chevron-${collapsed ? 'down' : 'up'}`} />\n </div>\n );\n }\n\n render() {\n const { icon, label, minHeight, count, children } = this.props;\n const { collapsed } = this.state;\n const accordionClasses = classnames('accordion', { collapsed });\n\n let panelHeight = minHeight;\n if (!collapsed) {\n panelHeight = minHeight && count ? (count + 1) * minHeight : 'none';\n }\n\n return (\n <div\n className={accordionClasses}\n style={{ maxHeight: panelHeight }}\n onClick={this.handleClick}\n >\n <div className=\"accordion-label\">\n {icon && <Icon name={icon} />}\n {label}\n <div className=\"indicator\">{this.renderIndicator()}</div>\n </div>\n {children}\n </div>\n );\n }\n}\n\nAccordion.defaultProps = {\n minHeight: 50,\n};\n\nAccordion.propTypes = {\n children: PropTypes.element.isRequired,\n label: PropTypes.string.isRequired,\n minHeight: PropTypes.number,\n count: PropTypes.number,\n counter: PropTypes.bool,\n icon: PropTypes.string,\n};\n\nexport default Accordion;\n","import moment from 'moment';\nimport { clearErrors, validationError, filterDeleted } from './utils';\nimport { get, put, del } from '../utils/fetch';\nimport { validator } from '../utils/validation';\nimport {\n slugify,\n preparePayload,\n sanitizeFrontMatter,\n computeRelativePath,\n} from '../utils/helpers';\nimport {\n collectionsAPIUrl,\n collectionAPIUrl,\n documentAPIUrl,\n} from '../constants/api';\n\nimport translations from '../translations';\nconst {\n getTitleRequiredMessage,\n getFilenameRequiredMessage,\n getFilenameNotValidMessage,\n} = translations;\n\n// Action Types\nexport const FETCH_COLLECTIONS_REQUEST = 'FETCH_COLLECTIONS_REQUEST';\nexport const FETCH_COLLECTIONS_SUCCESS = 'FETCH_COLLECTIONS_SUCCESS';\nexport const FETCH_COLLECTIONS_FAILURE = 'FETCH_COLLECTIONS_FAILURE';\nexport const FETCH_COLLECTION_REQUEST = 'FETCH_COLLECTION_REQUEST';\nexport const FETCH_COLLECTION_SUCCESS = 'FETCH_COLLECTION_SUCCESS';\nexport const FETCH_COLLECTION_FAILURE = 'FETCH_COLLECTION_FAILURE';\nexport const FETCH_DOCUMENT_REQUEST = 'FETCH_DOCUMENT_REQUEST';\nexport const FETCH_DOCUMENT_SUCCESS = 'FETCH_DOCUMENT_SUCCESS';\nexport const FETCH_DOCUMENT_FAILURE = 'FETCH_DOCUMENT_FAILURE';\nexport const PUT_DOCUMENT_REQUEST = 'PUT_DOCUMENT_REQUEST';\nexport const PUT_DOCUMENT_SUCCESS = 'PUT_DOCUMENT_SUCCESS';\nexport const PUT_DOCUMENT_FAILURE = 'PUT_DOCUMENT_FAILURE';\nexport const DELETE_DOCUMENT_REQUEST = 'DELETE_DOCUMENT_REQUEST';\nexport const DELETE_DOCUMENT_SUCCESS = 'DELETE_DOCUMENT_SUCCESS';\nexport const DELETE_DOCUMENT_FAILURE = 'DELETE_DOCUMENT_FAILURE';\n\n// Actions\nexport const fetchCollections = () => dispatch => {\n dispatch({ type: FETCH_COLLECTIONS_REQUEST });\n return get(\n collectionsAPIUrl(),\n { type: FETCH_COLLECTIONS_SUCCESS, name: 'collections' },\n { type: FETCH_COLLECTIONS_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const fetchCollection = (collection, directory = '') => dispatch => {\n dispatch({ type: FETCH_COLLECTION_REQUEST });\n return get(\n collectionAPIUrl(collection, directory),\n { type: FETCH_COLLECTION_SUCCESS, name: 'entries' },\n { type: FETCH_COLLECTION_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const fetchDocument = (collection, directory, filename) => dispatch => {\n dispatch({ type: FETCH_DOCUMENT_REQUEST });\n return get(\n documentAPIUrl(collection, directory, filename),\n { type: FETCH_DOCUMENT_SUCCESS, name: 'doc' },\n { type: FETCH_DOCUMENT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const createDocument = (collection, directory) => (\n dispatch,\n getState\n) => {\n // get edited fields from metadata state\n const metadata = getState().metadata.metadata;\n let { path, raw_content, title, date } = metadata;\n // if `path` is a falsy value or if appending a slash to it equals to\n // `directory`, generate filename from `title`.\n if ((!path || `${path}/` === directory) && title) {\n path = generateFilenameFromTitle(title, collection, date);\n } else {\n // validate otherwise\n const errors = validateDocument(metadata, collection);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n }\n // clear errors\n dispatch(clearErrors());\n\n const front_matter = sanitizeFrontMatter(metadata);\n\n // send the put request\n return put(\n documentAPIUrl(collection, directory, path),\n preparePayload({ raw_content, front_matter }),\n { type: PUT_DOCUMENT_SUCCESS, name: 'doc' },\n { type: PUT_DOCUMENT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const putDocument = (collection, directory, filename) => (\n dispatch,\n getState\n) => {\n // get edited fields from metadata state\n const metadata = getState().metadata.metadata;\n let { path, raw_content, title, date } = metadata;\n // if `path` is a falsy value or if appending a slash to it equals to\n // `directory`, generate filename from `title`.\n if ((!path || `${path}/` === directory) && title) {\n path = generateFilenameFromTitle(title, collection, date);\n } else {\n // validate otherwise\n const errors = validateDocument(metadata, collection);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n }\n // clear errors\n dispatch(clearErrors());\n\n const front_matter = sanitizeFrontMatter(metadata);\n\n // add collection type prefix to relative path\n const relative_path = directory\n ? `_${collection}/${directory}/${path}`\n : `_${collection}/${path}`;\n\n // send the put request\n return put(\n documentAPIUrl(collection, directory, filename),\n preparePayload({ path: relative_path, raw_content, front_matter }),\n { type: PUT_DOCUMENT_SUCCESS, name: 'doc' },\n { type: PUT_DOCUMENT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const deleteDocument = (collection, directory, filename) => dispatch => {\n const relative_path = computeRelativePath(directory, filename);\n return del(\n documentAPIUrl(collection, directory, filename),\n { type: DELETE_DOCUMENT_SUCCESS, name: 'doc', id: relative_path },\n { type: DELETE_DOCUMENT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nconst generateFilenameFromTitle = (title, collection, date) => {\n const slugifiedTitle = slugify(title);\n if (collection === 'posts') {\n // if date is provided, use it, otherwise generate it with today's date\n const docDate = date ? date.split(' ')[0] : moment().format('YYYY-MM-DD');\n return `${docDate}-${slugifiedTitle}.md`;\n }\n return `${slugifiedTitle}.md`;\n};\n\nconst validateDocument = (metadata, collection) => {\n let validations = { title: 'required' }; // base validations\n // base messages\n let messages = {\n 'title.required': getTitleRequiredMessage(),\n 'path.required': getFilenameRequiredMessage(),\n };\n\n if (collection === 'posts') {\n validations['path'] = 'required|date';\n messages['path.date'] = getFilenameNotValidMessage();\n } else {\n validations['path'] = 'required|filename';\n messages['path.filename'] = getFilenameNotValidMessage();\n }\n return validator(metadata, validations, messages);\n};\n\n// Reducer\nexport default function collections(\n state = {\n collections: [],\n entries: [],\n currentDocument: {},\n isFetching: false,\n updated: false,\n },\n action\n) {\n switch (action.type) {\n case FETCH_COLLECTIONS_REQUEST:\n case FETCH_COLLECTION_REQUEST:\n case FETCH_DOCUMENT_REQUEST:\n return {\n ...state,\n isFetching: true,\n };\n case FETCH_COLLECTIONS_SUCCESS:\n return {\n ...state,\n collections: action.collections,\n isFetching: false,\n };\n case FETCH_COLLECTION_SUCCESS:\n return {\n ...state,\n entries: action.entries,\n isFetching: false,\n };\n case FETCH_DOCUMENT_SUCCESS:\n return {\n ...state,\n currentDocument: action.doc,\n isFetching: false,\n };\n case FETCH_COLLECTIONS_FAILURE:\n return {\n ...state,\n collections: [],\n isFetching: false,\n };\n case FETCH_COLLECTION_FAILURE:\n return {\n ...state,\n entries: [],\n isFetching: false,\n };\n case FETCH_DOCUMENT_FAILURE:\n return {\n ...state,\n currentDocument: {},\n isFetching: false,\n };\n case PUT_DOCUMENT_SUCCESS:\n return {\n ...state,\n currentDocument: action.doc,\n updated: true,\n };\n case DELETE_DOCUMENT_SUCCESS:\n return {\n ...state,\n entries: filterDeleted(state.entries, action.id),\n };\n default:\n return {\n ...state,\n updated: false,\n };\n }\n}\n\n// Selectors\nexport const filterBySearchInput = (list, input) => {\n if (!input) {\n return list;\n }\n return list.filter(f =>\n (f.title || f.name).toLowerCase().includes(input.toLowerCase())\n );\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { Link } from 'react-router';\nimport { ADMIN_PREFIX } from '../constants';\nimport Splitter from '../components/Splitter';\nimport Icon from '../components/Icon';\nimport Accordion from '../components/Accordion';\nimport { fetchCollections } from '../ducks/collections';\nimport { capitalize } from '../utils/helpers';\nimport _ from 'underscore';\n\nimport translations from '../translations';\nconst SidebarTranslations = translations.sidebar;\n\nexport class Sidebar extends Component {\n componentDidMount() {\n const { fetchCollections } = this.props;\n fetchCollections();\n }\n\n renderCollections(hiddens = []) {\n const { collections } = this.props;\n\n if (!collections.length) {\n return null;\n }\n\n const collectionItems = _.map(collections, (col, i) => {\n if (col.label !== 'posts' && !hiddens.includes(col.label)) {\n return (\n <li key={i}>\n <Link\n activeClassName=\"active\"\n to={`${ADMIN_PREFIX}/collections/${col.label}`}\n >\n <Icon name=\"book\" />\n {col.sidebar_label || capitalize(col.label)}\n </Link>\n </li>\n );\n }\n }).filter(Boolean);\n\n const itemsCount = collectionItems.length;\n if (!itemsCount) {\n return null;\n }\n\n return (\n <Accordion\n count={itemsCount}\n icon=\"briefcase\"\n label={SidebarTranslations.collections}\n counter\n >\n <ul>{collectionItems}</ul>\n </Accordion>\n );\n }\n\n render() {\n const { config } = this.props;\n\n const defaults = {\n pages: {\n icon: 'file-text',\n link: 'pages',\n translation: 'pages',\n },\n datafiles: {\n icon: 'database',\n link: 'datafiles',\n translation: 'datafiles',\n splitterBefore: true,\n },\n staticfiles: {\n icon: 'file',\n link: 'staticfiles',\n translation: 'staticfiles',\n },\n configuration: {\n icon: 'cog',\n link: 'configuration',\n translation: 'configuration',\n splitterBefore: true,\n },\n };\n\n const defaultLinks = _.keys(defaults);\n let hiddenLinks;\n\n try {\n hiddenLinks = config.jekyll_admin.hidden_links || [];\n } catch (e) {\n hiddenLinks = [];\n }\n\n const visibleLinks = _.difference(defaultLinks, hiddenLinks);\n\n const links = [];\n _.each(visibleLinks, (link, index, list) => {\n const current = defaults[link];\n if (current.splitterBefore) {\n links.push(<Splitter key={'splitter' + index} />);\n }\n links.push(\n <li key={index}>\n <Link activeClassName=\"active\" to={`${ADMIN_PREFIX}/${current.link}`}>\n <Icon name={current.icon} />\n {SidebarTranslations[current.translation]}\n </Link>\n </li>\n );\n });\n\n const collectionsPanel = this.renderCollections(hiddenLinks);\n const postsPanel = !hiddenLinks.includes('posts');\n const draftsPanel = config && config.show_drafts;\n\n return (\n <div className=\"sidebar\">\n <Link className=\"logo\" to={`${ADMIN_PREFIX}/pages`} />\n <ul className=\"routes\">\n {collectionsPanel}\n {postsPanel && (\n <li>\n <Link\n activeClassName=\"active\"\n to={`${ADMIN_PREFIX}/collections/posts`}\n >\n <Icon name=\"book\" />\n {SidebarTranslations.posts}\n </Link>\n </li>\n )}\n {draftsPanel && (\n <li>\n <Link activeClassName=\"active\" to={`${ADMIN_PREFIX}/drafts`}>\n <Icon name=\"edit\" />\n {SidebarTranslations.drafts}\n </Link>\n </li>\n )}\n {(collectionsPanel || postsPanel || draftsPanel) && <Splitter />}\n {links}\n </ul>\n </div>\n );\n }\n}\n\nSidebar.propTypes = {\n collections: PropTypes.array.isRequired,\n fetchCollections: PropTypes.func.isRequired,\n config: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n collections: state.collections.collections,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchCollections,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Sidebar);\n","export const ADMIN_PREFIX = '/admin';\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router';\nimport Icon from '../components/Icon';\n\nexport class Header extends Component {\n render() {\n const { config } = this.props;\n return (\n <div className=\"header\">\n <h3 className=\"title\">\n <Link target=\"_blank\" to={config.url || '/'}>\n <Icon name=\"home\" />\n <span>{config.title || 'You have no title!'}</span>\n </Link>\n </h3>\n <span className=\"version\">v{process.env.REACT_APP_VERSION}</span>\n </div>\n );\n }\n}\n\nHeader.propTypes = {\n config: PropTypes.object.isRequired,\n};\n\nexport default Header;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport NotificationSystem from 'react-notification-system';\n\nexport class Notifications extends Component {\n componentDidMount() {\n this.notificationSystem = this.refs.notificationSystem;\n }\n\n componentWillReceiveProps(nextProps) {\n const { notification } = nextProps;\n this.notificationSystem.addNotification({\n title: notification.title,\n message: notification.message,\n level: notification.level,\n position: 'br',\n autoDismiss: 10,\n });\n }\n\n elementStyles = {\n Containers: {\n DefaultStyle: {\n padding: 15,\n width: 360,\n textAlign: 'center',\n },\n },\n Title: {\n DefaultStyle: {\n fontSize: 21,\n color: '#fff',\n },\n },\n NotificationItem: {\n DefaultStyle: {\n margin: 0,\n padding: '9px 15px 15px',\n fontSize: 15,\n borderRadius: 0,\n transition: '0.5s ease-in-out',\n },\n success: {\n color: '#fff',\n backgroundColor: '#088217',\n },\n error: {\n color: '#fff',\n backgroundColor: '#e21414',\n },\n warning: {\n color: '#fff',\n backgroundColor: '#ebad1a',\n },\n info: {\n color: '#fff',\n backgroundColor: '#369cc7',\n },\n },\n Dismiss: {\n DefaultStyle: {\n top: 7,\n right: 9,\n width: 25,\n height: 25,\n padding: 4,\n backgroundColor: 'transparent',\n border: '2px solid',\n opacity: '0.84',\n },\n },\n };\n\n render() {\n return (\n <NotificationSystem ref=\"notificationSystem\" style={this.elementStyles} />\n );\n }\n}\n\nNotifications.propTypes = {\n notification: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n notification: state.notifications.notification,\n});\n\nexport default connect(mapStateToProps)(Notifications);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { HotKeys } from 'react-hotkeys';\nimport DocumentTitle from 'react-document-title';\n\nimport { fetchConfig } from '../ducks/config';\nimport keyboardShortcuts from '../constants/keyboardShortcuts';\nimport { ADMIN_PREFIX } from '../constants';\n\n// Components\nimport Sidebar from './Sidebar';\nimport Header from './Header';\nimport Notifications from './Notifications';\n\nclass App extends Component {\n componentDidMount() {\n const { fetchConfig } = this.props;\n fetchConfig();\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n const { fetchConfig } = this.props;\n fetchConfig();\n }\n }\n\n componentDidUpdate(prevProps) {\n if (prevProps.isFetching && !this.props.isFetching) {\n const {\n config: {\n content: {\n jekyll_admin: { homepage },\n collections,\n },\n },\n router,\n } = this.props;\n\n const currentPathname = router.getCurrentLocation().pathname;\n\n if (homepage && currentPathname === ADMIN_PREFIX) {\n let url = `${ADMIN_PREFIX}/pages`;\n\n const collectionNames = Object.keys(collections).concat('posts');\n if (collectionNames.includes(homepage)) {\n url = `${ADMIN_PREFIX}/collections/${homepage}`;\n }\n\n if (\n ['drafts', 'datafiles', 'staticfiles', 'configuration'].includes(\n homepage\n )\n ) {\n url = `${ADMIN_PREFIX}/${homepage}`;\n }\n\n router.replace(url);\n }\n }\n }\n\n render() {\n const { config, isFetching } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n return (\n <DocumentTitle title=\"Jekyll Admin\">\n <HotKeys keyMap={keyboardShortcuts} className=\"wrapper\">\n {config.content && (\n <div>\n <Sidebar config={config.content} />\n <div className=\"container\">\n <Header config={config.content} />\n <div className=\"content\">{this.props.children}</div>\n </div>\n <Notifications />\n </div>\n )}\n </HotKeys>\n </DocumentTitle>\n );\n }\n}\n\nApp.propTypes = {\n children: PropTypes.element,\n fetchConfig: PropTypes.func.isRequired,\n config: PropTypes.object.isRequired,\n isFetching: PropTypes.bool.isRequired,\n updated: PropTypes.bool,\n};\n\nconst mapStateToProps = state => ({\n config: state.config.config,\n updated: state.config.updated,\n isFetching: state.config.isFetching,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators({ fetchConfig }, dispatch);\n\nexport default connect(mapStateToProps, mapDispatchToProps)(App);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport TextareaAutosize from 'react-textarea-autosize';\n\nexport default function StaticMetaSimple({ fieldValue }) {\n return (\n <div className=\"meta-value\">\n <TextareaAutosize\n className=\"field value-field\"\n value={`${fieldValue}`}\n disabled\n />\n </div>\n );\n}\n\nStaticMetaSimple.propTypes = {\n fieldValue: PropTypes.any.isRequired,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StaticMetaArray from './StaticMetaArray';\nimport StaticMetaObject from './StaticMetaObject';\nimport StaticMetaSimple from './StaticMetaSimple';\n\nconst FieldTypes = {\n array: StaticMetaArray,\n object: StaticMetaObject,\n simple: StaticMetaSimple,\n};\n\nexport default function StaticMetaObjectItem({ type, fieldKey, fieldValue }) {\n const CurrentComponent = FieldTypes[type];\n\n return (\n <div className=\"object-item-wrap\">\n <div className={`object-key ${type}`}>\n <input\n value={fieldKey}\n className=\"field key-field\"\n type=\"text\"\n disabled\n />\n </div>\n <div className=\"object-value\">\n <CurrentComponent fieldValue={fieldValue} />\n </div>\n </div>\n );\n}\n\nStaticMetaObjectItem.propTypes = {\n type: PropTypes.string.isRequired,\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any.isRequired,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport _ from 'underscore';\nimport StaticMetaObjectItem from './StaticMetaObjectItem';\nimport { computeFieldType } from '../../../utils/metadata';\n\nexport default function StaticMetaObject({ fieldValue }) {\n const items = _.map(fieldValue, (value, key) => {\n const type = computeFieldType(value);\n return (\n <StaticMetaObjectItem\n key={key}\n fieldKey={key}\n fieldValue={value}\n type={type}\n />\n );\n });\n\n return <div className=\"meta-value-object\">{items}</div>;\n}\n\nStaticMetaObject.propTypes = {\n fieldValue: PropTypes.any.isRequired,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StaticMetaArray from './StaticMetaArray';\nimport StaticMetaObject from './StaticMetaObject';\nimport StaticMetaSimple from './StaticMetaSimple';\n\nconst FieldTypes = {\n array: StaticMetaArray,\n object: StaticMetaObject,\n simple: StaticMetaSimple,\n};\n\nexport default function StaticMetaArrayItem({ type, fieldValue, index }) {\n const CurrentComponent = FieldTypes[type];\n\n return (\n <div className=\"array-item-wrap\">\n <div className=\"array\">\n <div className=\"array-header\">\n <span className=\"array-field-num\">{index + 1}.</span>\n </div>\n <CurrentComponent fieldValue={fieldValue} />\n </div>\n </div>\n );\n}\n\nStaticMetaArrayItem.propTypes = {\n type: PropTypes.string.isRequired,\n index: PropTypes.number.isRequired,\n fieldValue: PropTypes.any.isRequired,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StaticMetaArrayItem from './StaticMetaArrayItem';\nimport { computeFieldType } from '../../../utils/metadata';\n\nexport default function StaticMetaArray({ fieldValue }) {\n const items = fieldValue.map((item, i) => {\n const type = computeFieldType(item);\n return (\n <StaticMetaArrayItem key={i} index={i} fieldValue={item} type={type} />\n );\n });\n return <div className=\"meta-value-array\">{items}</div>;\n}\n\nStaticMetaArray.propTypes = {\n fieldValue: PropTypes.any.isRequired,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Icon from '../Icon';\nimport classnames from 'classnames';\n\nexport default class StaticMetaButton extends Component {\n state = {\n dropdown: false,\n };\n\n toggleDropdownState = () => {\n this.setState(state => ({ dropdown: !state.dropdown }));\n };\n\n render() {\n const { onEnableField } = this.props;\n\n const dropdownClasses = classnames('dropdown', {\n 'showing-dropdown': this.state.dropdown,\n });\n\n return (\n <div className=\"meta-buttons\">\n <span className={dropdownClasses}>\n <a\n className=\"meta-button\"\n tabIndex=\"1\"\n onClick={this.toggleDropdownState}\n onBlur={() => this.setState({ dropdown: false })}\n >\n <Icon name=\"chevron-down\" />\n </a>\n <div className=\"dropdown-wrap\">\n <span onMouseDown={() => onEnableField()}>\n <Icon name=\"pencil\" /> Override default\n </span>\n </div>\n </span>\n </div>\n );\n }\n}\n\nStaticMetaButton.propTypes = {\n onEnableField: PropTypes.func.isRequired,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport StaticMetaArray from './StaticMetaArray';\nimport StaticMetaObject from './StaticMetaObject';\nimport StaticMetaSimple from './StaticMetaSimple';\nimport StaticMetaButton from '../StaticMetaButton';\n\nconst FieldTypes = {\n array: StaticMetaArray,\n object: StaticMetaObject,\n simple: StaticMetaSimple,\n};\n\nexport default function StaticMetaField({\n type,\n fieldKey,\n fieldValue,\n enableField,\n}) {\n const CurrentComponent = FieldTypes[type];\n\n return (\n <div className=\"metafield default-field\">\n <div className={`meta-key ${type}`}>\n <input\n value={fieldKey}\n className=\"field key-field\"\n type=\"text\"\n disabled\n />\n <StaticMetaButton\n onEnableField={() => {\n enableField(`metadata['${fieldKey}']`, fieldValue);\n }}\n />\n </div>\n <CurrentComponent fieldValue={fieldValue} />\n </div>\n );\n}\n\nStaticMetaField.propTypes = {\n type: PropTypes.string.isRequired,\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any.isRequired,\n enableField: PropTypes.func.isRequired,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { getFilenameFromPath } from '../utils/helpers';\nimport Icon from './Icon';\n\nimport translations from '../translations';\nconst { getDeleteMessage } = translations;\n\nexport default class FilePreview extends Component {\n handleClickDelete(path) {\n const { splat, onClickDelete } = this.props;\n const filename = getFilenameFromPath(path);\n const confirm = window.confirm(getDeleteMessage(path));\n confirm && onClickDelete(splat, filename);\n }\n\n renderFileOverlay(file, splat) {\n if (file.from_theme) {\n return (\n <span className=\"theme-indicator\" title=\"Theme Asset\">\n <Icon name=\"diamond\" />\n </span>\n );\n } else if (splat !== 'index') {\n return (\n <button\n onClick={() => this.handleClickDelete(file.relative_path)}\n className=\"delete\"\n title=\"Delete file\"\n >\n x\n </button>\n );\n }\n }\n\n get isImageFile() {\n const {\n file: { type, extname },\n } = this.props;\n if (type === 'directory') {\n return false;\n }\n\n return /png|jpg|gif|jpeg|svg|ico/i.test(extname.substring(1));\n }\n\n render() {\n const { onClick, file, splat } = this.props;\n const node = this.isImageFile ? (\n <img src={file.http_url} alt={file.relative_path} />\n ) : (\n <div>\n <Icon name=\"file-text-o\" />\n </div>\n );\n\n const nodeLink = onClick ? (\n <a onClick={() => onClick(file.relative_path)}>{node}</a>\n ) : (\n <a href={file.http_url} target=\"_blank\" rel=\"noopener noreferrer\">\n {node}\n </a>\n );\n\n const filename = splat === 'index' ? file.relative_path : file.name;\n\n return (\n <div className=\"file-preview\">\n {this.renderFileOverlay(file, splat)}\n {nodeLink}\n <span className=\"filename\">{filename}</span>\n </div>\n );\n }\n}\n\nFilePreview.propTypes = {\n file: PropTypes.object.isRequired,\n splat: PropTypes.string.isRequired,\n onClickDelete: PropTypes.func,\n onClick: PropTypes.func,\n};\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router';\nimport { toTitleCase } from '../utils/helpers';\nimport { ADMIN_PREFIX } from '../constants';\n\nexport default function Breadcrumbs({ type, splat = '' }) {\n const nonCollectionTypes = ['pages', 'datafiles', 'drafts', 'staticfiles'];\n const base = nonCollectionTypes.includes(type)\n ? `${ADMIN_PREFIX}/${type}`\n : `${ADMIN_PREFIX}/collections/${type}`;\n\n let label = type;\n if (type === 'datafiles') {\n label = 'data files';\n } else if (type === 'staticfiles') {\n label = 'static files';\n }\n\n let nodes = [];\n if (splat) {\n const paths = splat.split('/');\n nodes = paths.map((path, i) => {\n const before = i === 0 ? '' : paths.slice(0, i).join('/') + '/';\n return (\n <li key={i}>\n <Link to={`${base}/${before}${path}`}>{path}</Link>\n </li>\n );\n });\n }\n\n return (\n <ul className=\"breadcrumbs\">\n <li>\n <Link to={base}>{toTitleCase(label)}</Link>\n </li>\n {nodes}\n </ul>\n );\n}\n\nBreadcrumbs.propTypes = {\n type: PropTypes.string.isRequired,\n splat: PropTypes.string,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n\nexport default class InputSearch extends Component {\n handleKeyPress = event => {\n const { search } = this.props;\n search(event.target.value);\n };\n\n render() {\n const { searchBy } = this.props;\n return (\n <input\n onKeyPress={this.handleKeyPress}\n type=\"text\"\n className=\"field\"\n placeholder={`Search by ${searchBy}`}\n />\n );\n }\n}\n\nInputSearch.propTypes = {\n search: PropTypes.func.isRequired,\n searchBy: PropTypes.string.isRequired,\n};\n","import _ from 'underscore';\nimport { filterDeleted } from './utils';\nimport { get, del } from '../utils/fetch';\nimport { computeRelativePath } from '../utils/helpers';\nimport { addNotification } from './notifications';\nimport { staticfilesAPIUrl, staticfileAPIUrl } from '../constants/api';\n\nimport translations from '../translations';\nconst {\n getSuccessMessage,\n getErrorMessage,\n getUploadSuccessMessage,\n getUploadErrorMessage,\n} = translations;\n\n// Action Types\nexport const FETCH_STATICFILES_REQUEST = 'FETCH_STATICFILES_REQUEST';\nexport const FETCH_STATICFILES_SUCCESS = 'FETCH_STATICFILES_SUCCESS';\nexport const FETCH_STATICFILES_FAILURE = 'FETCH_STATICFILES_FAILURE';\nexport const FETCH_STATICFILE_REQUEST = 'FETCH_STATICFILE_REQUEST';\nexport const FETCH_STATICFILE_SUCCESS = 'FETCH_STATICFILE_SUCCESS';\nexport const FETCH_STATICFILE_FAILURE = 'FETCH_STATICFILE_FAILURE';\nexport const PUT_STATICFILE_REQUEST = 'PUT_STATICFILE_REQUEST';\nexport const PUT_STATICFILE_SUCCESS = 'PUT_STATICFILE_SUCCESS';\nexport const PUT_STATICFILE_FAILURE = 'PUT_STATICFILE_FAILURE';\nexport const DELETE_STATICFILE_REQUEST = 'DELETE_STATICFILE_REQUEST';\nexport const DELETE_STATICFILE_SUCCESS = 'DELETE_STATICFILE_SUCCESS';\nexport const DELETE_STATICFILE_FAILURE = 'DELETE_STATICFILE_FAILURE';\n\n// Actions\nexport const fetchStaticFiles = (directory = '') => dispatch => {\n dispatch({ type: FETCH_STATICFILES_REQUEST });\n return get(\n staticfilesAPIUrl(directory),\n { type: FETCH_STATICFILES_SUCCESS, name: 'files' },\n { type: FETCH_STATICFILES_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const uploadStaticFiles = (directory, files) => dispatch => {\n _.each(files, file => {\n const reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onloadend = () => {\n const payload = JSON.stringify({\n encoded_content: reader.result.split('base64,')[1],\n });\n // send the put request\n return fetch(staticfileAPIUrl(directory, file.name), {\n method: 'PUT',\n body: payload,\n credentials: 'same-origin',\n })\n .then(data => {\n dispatch({ type: PUT_STATICFILE_SUCCESS });\n dispatch(fetchStaticFiles(directory));\n dispatch(\n addNotification(\n getSuccessMessage(),\n getUploadSuccessMessage(file.name),\n 'success'\n )\n );\n })\n .catch(error => {\n dispatch({ type: PUT_STATICFILE_FAILURE, error });\n dispatch(\n addNotification(getErrorMessage(), getUploadErrorMessage(), 'error')\n );\n });\n };\n });\n};\n\nexport const deleteStaticFile = (directory, filename) => dispatch => {\n const relative_path = computeRelativePath(directory, filename);\n return del(\n staticfileAPIUrl(directory, filename),\n { type: DELETE_STATICFILE_SUCCESS, name: 'file', id: relative_path },\n { type: DELETE_STATICFILE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\n// Reducer\nexport default function staticfiles(\n state = {\n files: [],\n isFetching: false,\n uploading: false, // TODO show loading gif\n },\n action\n) {\n switch (action.type) {\n case FETCH_STATICFILES_REQUEST:\n return {\n ...state,\n isFetching: true,\n };\n case FETCH_STATICFILES_SUCCESS:\n return {\n ...state,\n files: action.files,\n isFetching: false,\n };\n case FETCH_STATICFILES_FAILURE:\n return {\n ...state,\n isFetching: false,\n };\n case PUT_STATICFILE_REQUEST:\n return {\n ...state,\n uploading: true,\n };\n case PUT_STATICFILE_SUCCESS:\n return {\n ...state,\n uploading: false,\n };\n case PUT_STATICFILE_FAILURE:\n return {\n ...state,\n uploading: false,\n };\n case DELETE_STATICFILE_SUCCESS:\n return {\n ...state,\n files: filterDeleted(state.files, action.id),\n };\n default:\n return state;\n }\n}\n\n// Selectors\nexport const filterByFilename = (files, input) => {\n if (!input) {\n return files;\n }\n return files.filter(f => f.path.toLowerCase().includes(input.toLowerCase()));\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport DocumentTitle from 'react-document-title';\nimport Icon from '../../components/Icon';\nimport FilePreview from '../../components/FilePreview';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport InputSearch from '../../components/form/InputSearch';\nimport { search } from '../../ducks/utils';\nimport { fetchStaticFiles, filterByFilename } from '../../ducks/staticfiles';\nimport { ADMIN_PREFIX } from '../../constants';\n\nexport class StaticIndex extends Component {\n componentDidMount() {\n const { fetchStaticFiles } = this.props;\n fetchStaticFiles('index');\n }\n\n renderDirectoryListingBtn() {\n const to = `${ADMIN_PREFIX}/staticfiles`;\n\n return (\n <div className=\"page-buttons\">\n <Link className=\"btn btn-view\" to={to}>\n Directory Listing\n </Link>\n </div>\n );\n }\n\n renderPreviewNode() {\n const { files, onClickStaticFile } = this.props;\n\n if (files.length) {\n return (\n <div className=\"preview-container\">\n {files.map((file, i) => {\n return (\n <FilePreview\n key={i}\n onClick={onClickStaticFile}\n splat=\"index\"\n file={file}\n />\n );\n })}\n </div>\n );\n } else {\n return (\n <div className=\"preview-info\">\n <Icon name=\"exclamation-triangle\" />\n <h2>No files found!</h2>\n <h4>\n Upload files at 'Directory Listing' to have them displayed here.\n </h4>\n </div>\n );\n }\n }\n\n render() {\n const { isFetching, search, modalView } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n return (\n <DocumentTitle title=\"Static File Listing\">\n <div>\n <div className=\"content-header\">\n <Breadcrumbs type=\"staticfiles\" />\n {!modalView && this.renderDirectoryListingBtn()}\n <div className=\"pull-right\">\n <InputSearch searchBy=\"filename\" search={search} />\n </div>\n </div>\n <div className=\"static-list\">{this.renderPreviewNode()}</div>\n </div>\n </DocumentTitle>\n );\n }\n}\n\nStaticIndex.propTypes = {\n files: PropTypes.array.isRequired,\n isFetching: PropTypes.bool.isRequired,\n fetchStaticFiles: PropTypes.func.isRequired,\n search: PropTypes.func.isRequired,\n onClickStaticFile: PropTypes.func,\n modalView: PropTypes.bool,\n};\n\nconst mapStateToProps = state => ({\n files: filterByFilename(state.staticfiles.files, state.utils.input),\n isFetching: state.staticfiles.isFetching,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchStaticFiles,\n search,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(StaticIndex);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Modal from 'react-modal';\nimport StaticIndex from '../containers/views/StaticIndex';\nimport Icon from './Icon';\n\nexport default class FilePicker extends Component {\n state = {\n showModal: false,\n };\n\n customStyles = {\n overlay: {\n backgroundColor: 'rgba(0,0,0,0.6)',\n zIndex: 10,\n },\n content: {\n margin: 20,\n paddingTop: 0,\n paddingRight: 10,\n paddingLeft: 15,\n },\n };\n\n openModal = () => this.setState({ showModal: true });\n shutModal = () => this.setState({ showModal: false });\n\n onPickItem = path => {\n this.props.onPick(path);\n this.shutModal();\n };\n\n render() {\n return (\n <span className=\"images-wrapper\">\n <button onClick={this.openModal} ref=\"trigger\">\n <Icon name=\"picture-o\" />\n </button>\n <Modal\n isOpen={this.state.showModal}\n contentLabel=\"FilePicker\"\n onRequestClose={this.shutModal}\n style={this.customStyles}\n >\n <div className=\"content\">\n <StaticIndex onClickStaticFile={this.onPickItem} modalView />\n </div>\n </Modal>\n </span>\n );\n }\n}\n\nFilePicker.propTypes = {\n onPick: PropTypes.func.isRequired,\n};\n","import React, { Component, PropTypes } from 'react';\nimport TextareaAutosize from 'react-textarea-autosize';\nimport classnames from 'classnames';\n\nimport translations from '../../translations';\nconst { getDeleteMessage } = translations;\n\nexport default class MetaTags extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n tagInput: '',\n pageTags: props.fieldValue || [],\n autoSuggest: false,\n };\n }\n\n componentWillReceiveProps(nextProps) {\n const { fieldValue } = nextProps;\n this.setState({ pageTags: fieldValue || [] });\n }\n\n componentDidUpdate() {\n const { nameAttr, updateFieldValue } = this.props;\n updateFieldValue(nameAttr, this.state.pageTags);\n }\n\n createTag(value) {\n const { pageTags } = this.state;\n const clone = [...pageTags];\n\n // create tags only if they do not exist already\n if (!clone.includes(value)) {\n clone.push(value);\n\n this.setState(state => {\n return {\n pageTags: clone,\n tagInput: '',\n autoSuggest: false,\n };\n });\n }\n }\n\n deleteTag(index) {\n const { pageTags } = this.state;\n const clone = [...pageTags];\n\n const tagName = index === -1 ? clone.slice(-1).pop() : clone[index];\n const confirm = window.confirm(getDeleteMessage(`tag: ${tagName}`));\n\n if (confirm) {\n clone.splice(index, 1);\n this.setState({ pageTags: clone });\n this.refs.taginput.focus();\n }\n }\n\n // keys that when pressed and released creates a new tag from the input value.\n creators = [',', ' ', 'Enter'];\n\n handleKeyUp = e => {\n const { pageTags } = this.state;\n const input = e.target.value;\n\n if (input.length && this.creators.includes(e.key)) {\n this.createTag(input);\n } else if (pageTags.length && input.length === 0 && e.key === 'Backspace') {\n this.deleteTag(-1);\n }\n };\n\n handleOnChange = e => {\n const value = e.target.value;\n this.setState(state => {\n return { tagInput: value };\n });\n };\n\n showSuggestions = () => {\n this.setState(state => {\n return { autoSuggest: true };\n });\n };\n\n closeSuggestions = () => {\n this.setState(state => {\n return { autoSuggest: false };\n });\n };\n\n rectifyTag = tag => {\n const rectified = tag.toString().split(' ');\n this.setState(state => {\n return { pageTags: rectified };\n });\n };\n\n render() {\n const { pageTags } = this.state;\n const tagInput = `${this.state.tagInput}`;\n\n const suggestions = this.props.suggestions.filter(entry => {\n return entry.startsWith(tagInput);\n });\n\n if (!(pageTags instanceof Array)) {\n return (\n <span className=\"meta-error\">\n Expected an array of items. Found: <strong>{pageTags}</strong>\n <br />\n <span onClick={() => this.rectifyTag(pageTags)}>Click here</span>\n to correct.\n </span>\n );\n }\n\n const tagPool = pageTags.filter(Boolean); // filter out nil or empty elements\n const tags = tagPool.map((tag, i) => {\n return (\n <span key={i} className=\"tag\">\n {tag}\n <span className=\"delete-tag\" onClick={() => this.deleteTag(i)} />\n </span>\n );\n });\n\n const suggests = suggestions.map((item, i) => {\n if (!pageTags.includes(item)) {\n return (\n <li key={i} onClick={() => this.createTag(item)}>\n {item}\n </li>\n );\n }\n return null;\n }).filter(Boolean);\n\n const suggestionClasses = classnames('tag-suggestions', {\n visible: this.state.autoSuggest,\n });\n\n return (\n <div className=\"tags-wrap field value-field\">\n {tags.length > 0 && <div className=\"tags-list\">{tags}</div>}\n\n <div className=\"tags-input\">\n <input\n type=\"text\"\n onChange={this.handleOnChange}\n onFocus={this.showSuggestions}\n onKeyUp={this.handleKeyUp}\n value={tagInput.replace(/,|\\s+/, '')}\n ref=\"taginput\"\n />\n\n <TextareaAutosize\n className=\"field value-field\"\n value={this.state.pageTags.toString()}\n hidden\n />\n </div>\n {suggests.length > 0 && (\n <div className={suggestionClasses}>\n <ul>{suggests}</ul>\n <div className=\"close-suggestions\" onClick={this.closeSuggestions}>\n Close suggestions\n </div>\n </div>\n )}\n </div>\n );\n }\n}\n\nMetaTags.defaultProps = {\n fieldValue: [],\n suggestions: [],\n};\n\nMetaTags.propTypes = {\n updateFieldValue: PropTypes.func.isRequired,\n nameAttr: PropTypes.any.isRequired,\n suggestions: PropTypes.array,\n fieldValue: PropTypes.any,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport TextareaAutosize from 'react-textarea-autosize';\nimport DateTimePicker from 'react-widgets/lib/DateTimePicker';\nimport DropdownList from 'react-widgets/lib/DropdownList';\nimport moment from 'moment';\nimport momentLocalizer from 'react-widgets-moment';\nimport FilePicker from '../FilePicker';\nimport MetaTags from './MetaTags';\nimport 'react-widgets/dist/css/react-widgets.css';\n\nmomentLocalizer(moment);\n\nexport class MetaSimple extends Component {\n handleEditableChange = e => {\n const { nameAttr, updateFieldValue } = this.props;\n updateFieldValue(nameAttr, e.target.value);\n };\n\n handleDatepickerChange = (date, dateStr) => {\n const { nameAttr, updateFieldValue } = this.props;\n let formatted = moment(date).format('YYYY-MM-DD HH:mm:ss');\n updateFieldValue(nameAttr, formatted);\n };\n\n handleEditableBlur = e => {\n const { nameAttr, updateFieldValue } = this.props;\n updateFieldValue(nameAttr, e.target.value.trim());\n };\n\n renderEditable() {\n const { fieldValue } = this.props;\n return (\n <TextareaAutosize\n onChange={this.handleEditableChange}\n onBlur={this.handleEditableBlur}\n className=\"field value-field\"\n value={`${fieldValue}`}\n />\n );\n }\n\n renderDatepicker() {\n const { fieldValue } = this.props;\n let dateValue = new Date(fieldValue);\n if (`${dateValue}` === 'Invalid Date') dateValue = null;\n return (\n <DateTimePicker\n onChange={this.handleDatepickerChange}\n className=\"date-field\"\n value={dateValue}\n />\n );\n }\n\n onPickItem = path => {\n const { nameAttr, updateFieldValue } = this.props;\n this.refs.imagepicker.value = path;\n updateFieldValue(nameAttr, path);\n };\n\n renderStaticFilePicker() {\n const { fieldValue } = this.props;\n return (\n <div className=\"imagepicker\">\n <TextareaAutosize\n onChange={this.handleEditableChange}\n className=\"field value-field\"\n value={fieldValue}\n ref=\"imagepicker\"\n />\n <FilePicker onPick={this.onPickItem} />\n </div>\n );\n }\n\n handleLayoutChange = value => {\n const { nameAttr, updateFieldValue } = this.props;\n updateFieldValue(nameAttr, value);\n };\n\n renderLayoutPicker() {\n const { fieldValue, siteMeta } = this.props;\n\n if (!siteMeta) return this.renderEditable();\n const layouts = siteMeta.layouts || [];\n\n return (\n <DropdownList\n className=\"layout-field\"\n data={['none', ...layouts]}\n defaultValue={fieldValue}\n onChange={this.handleLayoutChange}\n />\n );\n }\n\n renderTagsInput(key) {\n const { fieldValue, nameAttr, updateFieldValue, siteMeta } = this.props;\n const suggestions = (siteMeta && siteMeta[key]) || [];\n\n return (\n <MetaTags\n fieldValue={fieldValue}\n nameAttr={nameAttr}\n updateFieldValue={updateFieldValue}\n suggestions={suggestions}\n />\n );\n }\n\n render() {\n const { fieldKey, nameAttr } = this.props;\n\n let node;\n switch (fieldKey) {\n case 'date':\n node = this.renderDatepicker();\n break;\n case 'image':\n case 'file':\n node = this.renderStaticFilePicker();\n break;\n case 'tags':\n case 'categories':\n node = this.renderTagsInput(fieldKey);\n break;\n default:\n node = this.renderEditable();\n }\n\n if (nameAttr === \"metadata['layout']\") {\n node = this.renderLayoutPicker();\n }\n\n return <div className=\"meta-value\">{node}</div>;\n }\n}\n\nMetaSimple.propTypes = {\n parentType: PropTypes.string.isRequired,\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any,\n updateFieldValue: PropTypes.func.isRequired,\n nameAttr: PropTypes.any.isRequired,\n siteMeta: PropTypes.object,\n};\n\nexport default MetaSimple;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Icon from '../Icon';\n\nexport default class MetaButtons extends Component {\n state = {\n dropdown: false,\n };\n\n fieldTypes = {\n simple: {\n icon: 'pencil',\n label: 'Simple',\n },\n array: {\n icon: 'list-ol',\n label: 'List',\n },\n object: {\n icon: 'th-large',\n label: 'Object',\n },\n };\n\n fieldTypeKeys = Object.keys(this.fieldTypes);\n\n toggleDropdownState = () => {\n this.setState(state => {\n return { dropdown: !state.dropdown };\n });\n };\n\n renderDropdownItems(type) {\n const { onConvertClick, parentKey } = this.props;\n\n if (parentKey === 'tags') return null;\n\n return this.fieldTypeKeys\n .map((ftype, i) => {\n if (type !== ftype) {\n const { icon, label } = this.fieldTypes[ftype];\n return (\n <span key={i} onMouseDown={() => onConvertClick(ftype)}>\n <Icon name={icon} />\n Convert to {label}\n </span>\n );\n }\n\n return null;\n })\n .filter(Boolean);\n }\n\n render() {\n const {\n currentType,\n parentType,\n onRemoveClick,\n isDefaultField,\n } = this.props;\n const sortableHandle = (\n <span className=\"move\">\n <Icon name=\"arrows\" />\n </span>\n );\n\n const dropdownClasses = classnames('dropdown', {\n 'showing-dropdown': this.state.dropdown,\n });\n\n return (\n <div className=\"meta-buttons\">\n {parentType === 'array' && sortableHandle}\n <span className={dropdownClasses}>\n <a\n className=\"meta-button\"\n tabIndex=\"1\"\n onClick={this.toggleDropdownState}\n onBlur={() => this.setState({ dropdown: false })}\n >\n <Icon name=\"chevron-down\" />\n </a>\n <div className=\"dropdown-wrap\">\n {this.renderDropdownItems(currentType)}\n <span onMouseDown={() => onRemoveClick()} className=\"remove-field\">\n <Icon name={isDefaultField ? 'undo' : 'trash-o'} />\n {isDefaultField ? 'Revert to default' : 'Remove field'}\n </span>\n </div>\n </span>\n </div>\n );\n }\n}\n\nMetaButtons.propTypes = {\n currentType: PropTypes.string.isRequired,\n parentType: PropTypes.string.isRequired,\n onConvertClick: PropTypes.func.isRequired,\n onRemoveClick: PropTypes.func.isRequired,\n parentKey: PropTypes.string,\n isDefaultField: PropTypes.bool,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { findDOMNode } from 'react-dom';\nimport MetaArray from './MetaArray';\nimport MetaObject from './MetaObject';\nimport MetaSimple from './MetaSimple';\nimport MetaButtons from './MetaButtons';\n\nexport class MetaObjectItem extends Component {\n handleConvertClick(type) {\n const { convertField, nameAttr } = this.props;\n convertField(nameAttr, type);\n }\n\n handleKeyBlur() {\n const { namePrefix, fieldKey, updateFieldKey } = this.props;\n let currentValue = findDOMNode(this.refs.field_key).value;\n if (fieldKey !== currentValue && currentValue !== '') {\n updateFieldKey(namePrefix, fieldKey, currentValue);\n }\n }\n\n handleRemoveClick() {\n const { removeField, namePrefix, fieldKey } = this.props;\n removeField(namePrefix, fieldKey);\n }\n\n render() {\n const {\n type,\n fieldKey,\n fieldValue,\n nameAttr,\n addField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n convertField,\n key_prefix,\n moveArrayItem,\n } = this.props;\n const FieldTypes = {\n array: MetaArray,\n object: MetaObject,\n simple: MetaSimple,\n };\n const CurrentComponent = FieldTypes[type];\n return (\n <div ref=\"wrap\" className=\"object-item-wrap\">\n <div className={`object-key ${type}`}>\n <input\n ref=\"field_key\"\n onBlur={e => this.handleKeyBlur(e)}\n defaultValue={fieldKey}\n className=\"field key-field\"\n type=\"text\"\n placeholder=\"Key\"\n />\n <MetaButtons\n currentType={type}\n parentType=\"object\"\n onConvertClick={type => this.handleConvertClick(type)}\n onRemoveClick={() => this.handleRemoveClick()}\n />\n </div>\n <div className=\"object-value\">\n <CurrentComponent\n key_prefix={key_prefix}\n parentType=\"object\"\n fieldKey={fieldKey}\n fieldValue={fieldValue}\n addField={addField}\n removeField={removeField}\n updateFieldKey={updateFieldKey}\n updateFieldValue={updateFieldValue}\n moveArrayItem={moveArrayItem}\n convertField={convertField}\n nameAttr={nameAttr}\n namePrefix={nameAttr}\n />\n </div>\n </div>\n );\n }\n}\n\nMetaObjectItem.propTypes = {\n type: PropTypes.string.isRequired,\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any.isRequired,\n nameAttr: PropTypes.string.isRequired,\n namePrefix: PropTypes.string.isRequired,\n addField: PropTypes.func.isRequired,\n removeField: PropTypes.func.isRequired,\n convertField: PropTypes.func.isRequired,\n updateFieldKey: PropTypes.func.isRequired,\n updateFieldValue: PropTypes.func.isRequired,\n moveArrayItem: PropTypes.func.isRequired,\n key_prefix: PropTypes.string.isRequired,\n};\nexport default MetaObjectItem;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport _ from 'underscore';\nimport MetaObjectItem from './MetaObjectItem';\nimport { computeFieldType } from '../../utils/metadata';\n\nexport class MetaObject extends Component {\n render() {\n const {\n fieldKey,\n fieldValue,\n namePrefix,\n addField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n convertField,\n key_prefix,\n moveArrayItem,\n } = this.props;\n const items = _.map(fieldValue, (value, key) => {\n const type = computeFieldType(value, key);\n return (\n <MetaObjectItem\n key={key}\n key_prefix={key_prefix}\n fieldKey={key}\n fieldValue={value}\n type={type}\n addField={addField}\n removeField={removeField}\n updateFieldKey={updateFieldKey}\n updateFieldValue={updateFieldValue}\n moveArrayItem={moveArrayItem}\n convertField={convertField}\n nameAttr={`${namePrefix}['${key}']`}\n namePrefix={namePrefix}\n />\n );\n });\n return (\n <div className=\"meta-value-object\">\n {items}\n <a\n onClick={() => addField(namePrefix)}\n className=\"add-field-object\"\n title=\"Add new key/value pair\"\n >\n New key/value pair under <strong>{fieldKey}</strong>\n </a>\n </div>\n );\n }\n}\n\nMetaObject.propTypes = {\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any.isRequired,\n nameAttr: PropTypes.string.isRequired,\n namePrefix: PropTypes.string.isRequired,\n addField: PropTypes.func.isRequired,\n removeField: PropTypes.func.isRequired,\n convertField: PropTypes.func.isRequired,\n updateFieldKey: PropTypes.func.isRequired,\n updateFieldValue: PropTypes.func.isRequired,\n moveArrayItem: PropTypes.func.isRequired,\n key_prefix: PropTypes.string.isRequired,\n};\n\nexport default MetaObject;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport MetaArray from './MetaArray';\nimport MetaObject from './MetaObject';\nimport MetaSimple from './MetaSimple';\nimport MetaButtons from './MetaButtons';\n\nexport class MetaArrayItem extends Component {\n handleConvertClick(type) {\n const { convertField, nameAttr } = this.props;\n convertField(nameAttr, type);\n }\n\n handleRemoveClick() {\n const { removeField, namePrefix, index } = this.props;\n removeField(namePrefix, index);\n }\n\n render() {\n const {\n type,\n fieldKey,\n fieldValue,\n index,\n nameAttr,\n addField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n moveArrayItem,\n convertField,\n key_prefix,\n } = this.props;\n const FieldTypes = {\n array: MetaArray,\n object: MetaObject,\n simple: MetaSimple,\n };\n const CurrentComponent = FieldTypes[type];\n return (\n <div ref=\"wrap\" data-id={index} className=\"array-item-wrap\">\n <div className=\"array\">\n <div className=\"array-header\">\n <span className=\"array-field-num\">{index + 1}.</span>\n <MetaButtons\n currentType={type}\n parentType=\"array\"\n onConvertClick={type => this.handleConvertClick(type)}\n onRemoveClick={() => this.handleRemoveClick()}\n />\n </div>\n <CurrentComponent\n key_prefix={key_prefix}\n parentType=\"array\"\n fieldKey={fieldKey}\n fieldValue={fieldValue}\n addField={addField}\n removeField={removeField}\n updateFieldKey={updateFieldKey}\n updateFieldValue={updateFieldValue}\n moveArrayItem={moveArrayItem}\n convertField={convertField}\n nameAttr={nameAttr}\n namePrefix={nameAttr}\n />\n </div>\n </div>\n );\n }\n}\n\nMetaArrayItem.propTypes = {\n type: PropTypes.string.isRequired,\n index: PropTypes.number.isRequired,\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any.isRequired,\n addField: PropTypes.func.isRequired,\n removeField: PropTypes.func.isRequired,\n updateFieldKey: PropTypes.func.isRequired,\n updateFieldValue: PropTypes.func.isRequired,\n moveArrayItem: PropTypes.func.isRequired,\n convertField: PropTypes.func.isRequired,\n nameAttr: PropTypes.string.isRequired,\n namePrefix: PropTypes.string.isRequired,\n key_prefix: PropTypes.string.isRequired,\n};\n\nexport default MetaArrayItem;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport Sortable from 'sortablejs';\nimport Icon from '../Icon';\nimport MetaArrayItem from './MetaArrayItem';\nimport { computeFieldType } from '../../utils/metadata';\n\nexport class MetaArray extends Component {\n sortableGroupDecorator(component) {\n const { moveArrayItem, namePrefix } = this.props;\n if (component) {\n const options = {\n draggable: '.array-item-wrap',\n group: { name: 'meta-array-items', pull: false, put: false },\n handle: '.move',\n animation: 0,\n onEnd: e => {\n let srcInd = e.item.getAttribute('data-id');\n moveArrayItem(namePrefix, srcInd, e.newIndex);\n },\n };\n Sortable.create(component, options);\n }\n }\n\n render() {\n const {\n fieldKey,\n fieldValue,\n namePrefix,\n addField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n moveArrayItem,\n convertField,\n key_prefix,\n } = this.props;\n const items = fieldValue.map((item, i) => {\n const type = computeFieldType(item);\n return (\n <MetaArrayItem\n key={`${key_prefix}-${i}`}\n key_prefix={key_prefix}\n index={i}\n fieldKey={fieldKey}\n fieldValue={item}\n type={type}\n addField={addField}\n removeField={removeField}\n updateFieldKey={updateFieldKey}\n updateFieldValue={updateFieldValue}\n moveArrayItem={moveArrayItem}\n convertField={convertField}\n nameAttr={`${namePrefix}[${i}]`}\n namePrefix={namePrefix}\n />\n );\n });\n return (\n <div\n className=\"meta-value-array\"\n ref={this.sortableGroupDecorator.bind(this)}\n >\n {items}\n <a\n onClick={() => addField(namePrefix)}\n className=\"add-field-array\"\n title=\"Add new list item\"\n >\n <Icon name=\"plus\" />\n </a>\n </div>\n );\n }\n}\n\nMetaArray.propTypes = {\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any.isRequired,\n nameAttr: PropTypes.string.isRequired,\n namePrefix: PropTypes.string.isRequired,\n addField: PropTypes.func.isRequired,\n removeField: PropTypes.func.isRequired,\n updateFieldKey: PropTypes.func.isRequired,\n updateFieldValue: PropTypes.func.isRequired,\n convertField: PropTypes.func.isRequired,\n moveArrayItem: PropTypes.func.isRequired,\n key_prefix: PropTypes.string.isRequired,\n};\n\nexport default MetaArray;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { findDOMNode } from 'react-dom';\nimport MetaArray from './MetaArray';\nimport MetaObject from './MetaObject';\nimport MetaSimple from './MetaSimple';\nimport MetaButtons from './MetaButtons';\n\nexport class MetaField extends Component {\n componentDidMount() {\n const isNewField = /New field/.test(this.props.fieldKey);\n isNewField && this.refs.field_key.select();\n }\n\n handleConvertClick(type) {\n const { convertField, nameAttr } = this.props;\n convertField(nameAttr, type);\n }\n\n handleKeyBlur() {\n const { namePrefix, fieldKey, updateFieldKey } = this.props;\n let currentValue = findDOMNode(this.refs.field_key).value;\n if (fieldKey !== currentValue && currentValue !== '') {\n updateFieldKey(namePrefix, fieldKey, currentValue);\n }\n }\n\n handleRemoveClick() {\n const { removeField, namePrefix, fieldKey } = this.props;\n removeField(namePrefix, fieldKey);\n }\n\n render() {\n const {\n type,\n parentType,\n fieldKey,\n fieldValue,\n namePrefix,\n addField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n moveArrayItem,\n convertField,\n key_prefix,\n siteMeta,\n isInDefaultState,\n isDefaultField,\n } = this.props;\n\n const FieldTypes = {\n array: MetaArray,\n object: MetaObject,\n simple: MetaSimple,\n };\n const CurrentComponent = FieldTypes[type];\n return (\n <div ref=\"wrap\" className=\"metafield\">\n <div className={`meta-key ${type}`}>\n <input\n ref=\"field_key\"\n onBlur={() => this.handleKeyBlur()}\n defaultValue={fieldKey}\n className=\"field key-field\"\n type=\"text\"\n placeholder=\"Key\"\n disabled={isInDefaultState}\n />\n <MetaButtons\n currentType={type}\n isDefaultField={isDefaultField}\n parentType=\"top\"\n parentKey={fieldKey}\n onConvertClick={type => this.handleConvertClick(type)}\n onRemoveClick={() => this.handleRemoveClick()}\n />\n </div>\n <CurrentComponent\n key_prefix={key_prefix}\n fieldKey={fieldKey}\n parentType={parentType}\n fieldValue={fieldValue}\n addField={addField}\n removeField={removeField}\n updateFieldKey={updateFieldKey}\n updateFieldValue={updateFieldValue}\n moveArrayItem={moveArrayItem}\n convertField={convertField}\n nameAttr={`${namePrefix}['${fieldKey}']`}\n namePrefix={`${namePrefix}['${fieldKey}']`}\n siteMeta={siteMeta}\n isInDefaultState={isInDefaultState}\n />\n </div>\n );\n }\n}\n\nMetaField.propTypes = {\n type: PropTypes.string.isRequired,\n parentType: PropTypes.string.isRequired,\n addField: PropTypes.func.isRequired,\n removeField: PropTypes.func.isRequired,\n updateFieldKey: PropTypes.func.isRequired,\n updateFieldValue: PropTypes.func.isRequired,\n moveArrayItem: PropTypes.func.isRequired,\n convertField: PropTypes.func.isRequired,\n fieldKey: PropTypes.string.isRequired,\n fieldValue: PropTypes.any,\n nameAttr: PropTypes.string.isRequired,\n namePrefix: PropTypes.string.isRequired,\n key_prefix: PropTypes.string.isRequired,\n siteMeta: PropTypes.object,\n isInDefaultState: PropTypes.bool,\n isDefaultField: PropTypes.bool,\n};\n\nexport default MetaField;\n","import {\n addFieldToMetadata,\n removeFieldFromMetadata,\n updateMetadataFieldKey,\n updateMetadataFieldValue,\n moveMetadataArrayItem,\n convertMetadataField,\n} from '../utils/metadata';\n\n// Action Types\nexport const UPDATE_TITLE = 'UPDATE_TITLE';\nexport const UPDATE_BODY = 'UPDATE_BODY';\nexport const UPDATE_PATH = 'UPDATE_PATH';\nexport const STORE_CONTENT_FIELDS = 'STORE_CONTENT_FIELDS';\nexport const ADD_METAFIELD = 'ADD_METAFIELD';\nexport const REMOVE_METAFIELD = 'REMOVE_METAFIELD';\nexport const UPDATE_FIELD_KEY = 'UPDATE_FIELD_KEY';\nexport const UPDATE_FIELD_VALUE = 'UPDATE_FIELD_VALUE';\nexport const MOVE_ARRAY_ITEM = 'MOVE_ARRAY_ITEM';\nexport const CONVERT_FIELD = 'CONVERT_FIELD';\nexport const ENABLE_FIELD = 'ENABLE_FIELD';\n\n// Actions\nexport const storeContentFields = content => ({\n type: STORE_CONTENT_FIELDS,\n content,\n});\n\nexport const addField = namePrefix => ({\n type: ADD_METAFIELD,\n namePrefix,\n});\n\nexport const removeField = (namePrefix, key) => ({\n type: REMOVE_METAFIELD,\n namePrefix,\n key,\n});\n\nexport const enableField = (nameAttr, value) => ({\n type: ENABLE_FIELD,\n nameAttr,\n value,\n});\n\nexport const updateFieldKey = (namePrefix, fieldKey, newKey) => ({\n type: UPDATE_FIELD_KEY,\n namePrefix,\n fieldKey,\n newKey,\n});\n\nexport const updateFieldValue = (nameAttr, value) => ({\n type: UPDATE_FIELD_VALUE,\n nameAttr,\n value,\n});\n\nexport const moveArrayItem = (namePrefix, srcInd, targetInd) => ({\n type: MOVE_ARRAY_ITEM,\n namePrefix,\n srcInd,\n targetInd,\n});\n\nexport const convertField = (nameAttr, convertType) => ({\n type: CONVERT_FIELD,\n nameAttr,\n convertType,\n});\n\nexport const updateTitle = title => ({\n type: UPDATE_TITLE,\n title,\n});\n\nexport const updateBody = body => ({\n type: UPDATE_BODY,\n body,\n});\n\nexport const updatePath = path => ({\n type: UPDATE_PATH,\n path,\n});\n\n// Reducer\nexport default function metadata( // TODO normalize the metadata\n state = {\n metadata: {},\n new_field_count: 1,\n key_prefix: '', // force children to be rerendered on sort\n fieldChanged: false,\n },\n action\n) {\n switch (action.type) {\n case UPDATE_TITLE:\n return {\n ...state,\n metadata: {\n ...state.metadata,\n title: action.title,\n },\n fieldChanged: true,\n };\n case UPDATE_BODY:\n return {\n ...state,\n metadata: {\n ...state.metadata,\n raw_content: action.body,\n },\n fieldChanged: true,\n };\n case UPDATE_PATH:\n return {\n ...state,\n metadata: {\n ...state.metadata,\n path: action.path,\n },\n fieldChanged: true,\n };\n case STORE_CONTENT_FIELDS:\n return {\n ...state,\n metadata: action.content,\n };\n case ADD_METAFIELD:\n return {\n ...state,\n metadata: addFieldToMetadata(state, action.namePrefix),\n new_field_count: state.new_field_count + 1,\n };\n case REMOVE_METAFIELD:\n return {\n ...state,\n metadata: removeFieldFromMetadata(state, action.namePrefix, action.key),\n fieldChanged: true,\n key_prefix: `${Math.random() * 100}`,\n };\n case UPDATE_FIELD_KEY:\n return {\n ...state,\n metadata: updateMetadataFieldKey(\n state,\n action.namePrefix,\n action.fieldKey,\n action.newKey.trim()\n ),\n fieldChanged: true,\n };\n case UPDATE_FIELD_VALUE:\n return {\n ...state,\n metadata: updateMetadataFieldValue(\n state,\n action.nameAttr,\n action.value\n ),\n fieldChanged: true,\n };\n case MOVE_ARRAY_ITEM:\n return {\n ...state,\n metadata: moveMetadataArrayItem(\n state,\n action.namePrefix,\n action.srcInd,\n action.targetInd\n ),\n key_prefix: `${Math.random() * 100}`,\n fieldChanged: true,\n };\n case CONVERT_FIELD:\n return {\n ...state,\n metadata: convertMetadataField(\n state,\n action.nameAttr,\n action.convertType\n ),\n new_field_count: state.new_field_count + 1,\n fieldChanged: true,\n };\n case ENABLE_FIELD:\n return {\n ...state,\n metadata: updateMetadataFieldValue(\n state,\n action.nameAttr,\n action.value\n ),\n fieldChanged: true,\n };\n default:\n return {\n ...state,\n fieldChanged: false,\n };\n }\n}\n","import { getSiteMetaUrl } from '../constants/api';\nimport { get } from '../utils/fetch';\n\n// Action Types\nexport const FETCH_SITE_META_REQUEST = 'FETCH_SITE_META_REQUEST';\nexport const FETCH_SITE_META_SUCCESS = 'FETCH_SITE_META_SUCCESS';\nexport const FETCH_SITE_META_FAILURE = 'FETCH_SITE_META_FAILURE';\n\n// Actions\nexport const fetchSiteMeta = () => dispatch => {\n dispatch({ type: FETCH_SITE_META_REQUEST });\n return get(\n getSiteMetaUrl(),\n { type: FETCH_SITE_META_SUCCESS, name: 'site' },\n { type: FETCH_SITE_META_FAILURE, name: 'error' },\n dispatch\n );\n};\n\n// Reducer\nexport default function siteMeta(\n state = {\n site: {},\n isFetching: false,\n },\n action\n) {\n switch (action.type) {\n case FETCH_SITE_META_REQUEST:\n return {\n ...state,\n isFetching: true,\n };\n case FETCH_SITE_META_SUCCESS:\n return {\n ...state,\n site: action.site,\n isFetching: false,\n };\n case FETCH_SITE_META_FAILURE:\n return {\n ...state,\n isFetching: false,\n };\n default:\n return state;\n }\n}\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport _ from 'underscore';\nimport StaticMetaField from '../components/metadata/statics/StaticMetaField';\nimport MetaField from '../components/metadata/MetaField';\nimport Icon from '../components/Icon';\nimport {\n storeContentFields,\n addField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n moveArrayItem,\n convertField,\n enableField,\n} from '../ducks/metadata';\nimport { fetchSiteMeta } from '../ducks/siteMeta';\nimport { computeFieldType } from '../utils/metadata';\n\nexport class MetaFields extends Component {\n componentDidMount() {\n const { storeContentFields, fields, fetchSiteMeta, dataview } = this.props;\n if (!dataview) fetchSiteMeta();\n storeContentFields(fields);\n }\n\n shouldComponentUpdate(nextProps) {\n return !_.isEqual(nextProps.metadata, this.props.metadata);\n }\n\n render() {\n const {\n metadata,\n addField,\n enableField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n moveArrayItem,\n convertField,\n key_prefix,\n dataview,\n site,\n staticFields,\n } = this.props;\n\n let visibleKeys = { ...staticFields, ...metadata };\n\n if (!dataview) {\n visibleKeys = _.omit(visibleKeys, ['title', 'path', 'raw_content']);\n }\n\n const metafieldsClass = classnames({\n datafields: dataview,\n metafields: !dataview,\n });\n\n const defaultFieldsNotOverwritten = _.omit(\n staticFields,\n Object.keys(metadata)\n );\n\n const metafields = _.map(visibleKeys, (field, key) => {\n const type = computeFieldType(field, key);\n if (defaultFieldsNotOverwritten.hasOwnProperty(key)) {\n return (\n <StaticMetaField\n key={key}\n type={type}\n fieldKey={key}\n fieldValue={field}\n enableField={enableField}\n />\n );\n }\n\n return (\n <MetaField\n key={key}\n key_prefix={key_prefix}\n type={type}\n parentType=\"top\"\n fieldKey={key}\n fieldValue={field}\n addField={addField}\n removeField={removeField}\n updateFieldKey={updateFieldKey}\n updateFieldValue={updateFieldValue}\n moveArrayItem={moveArrayItem}\n convertField={convertField}\n nameAttr={`metadata['${key}']`}\n namePrefix={`metadata`}\n siteMeta={dataview ? null : site}\n isInDefaultState={defaultFieldsNotOverwritten.hasOwnProperty(key)}\n isDefaultField={staticFields && staticFields.hasOwnProperty(key)}\n />\n );\n });\n\n const newWrapper = dataview ? (\n <div className=\"data-new\">\n <a onClick={() => addField('metadata')}>\n <Icon name=\"plus-circle\" /> New data field\n </a>\n </div>\n ) : (\n <div className=\"meta-new\">\n <a onClick={() => addField('metadata')} className=\"tooltip\">\n <Icon name=\"plus-circle\" /> New metadata field\n <span className=\"tooltip-text\">\n Metadata will be stored as the <b>YAML front matter</b> within the\n document.\n </span>\n </a>\n <small className=\"tooltip pull-right\">\n <Icon name=\"info-circle\" />\n Special Keys\n <span className=\"tooltip-text\">\n You can use special keys like <b>date</b>, <b>file</b>, <b>image</b>\n , <b>layout</b> or <b>tags</b> for user-friendly functionalities.\n </span>\n </small>\n </div>\n );\n\n return (\n <div className={metafieldsClass}>\n {metafields}\n {newWrapper}\n </div>\n );\n }\n}\n\nMetaFields.propTypes = {\n fields: PropTypes.object.isRequired,\n metadata: PropTypes.object.isRequired,\n key_prefix: PropTypes.string.isRequired,\n storeContentFields: PropTypes.func.isRequired,\n addField: PropTypes.func.isRequired,\n removeField: PropTypes.func.isRequired,\n updateFieldKey: PropTypes.func.isRequired,\n updateFieldValue: PropTypes.func.isRequired,\n moveArrayItem: PropTypes.func.isRequired,\n convertField: PropTypes.func.isRequired,\n fetchSiteMeta: PropTypes.func.isRequired,\n dataview: PropTypes.bool,\n site: PropTypes.object,\n staticFields: PropTypes.object.isRequired,\n enableField: PropTypes.func.isRequired,\n};\n\nconst mapStateToProps = state => ({\n metadata: state.metadata.metadata,\n key_prefix: state.metadata.key_prefix,\n site: state.meta.site,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n storeContentFields,\n fetchSiteMeta,\n addField,\n enableField,\n removeField,\n updateFieldKey,\n updateFieldValue,\n moveArrayItem,\n convertField,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(MetaFields);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport MetaFields from '../containers/MetaFields';\n\nclass DataGUI extends Component {\n handleChange = e => this.props.onChange(e.target.value);\n\n renderPathFields(slug, ext) {\n return (\n <form className=\"datafile-path\">\n <fieldset className=\"filename\">\n <legend>Path (without extension)</legend>\n <input\n type=\"text\"\n id=\"path\"\n defaultValue={slug}\n placeholder=\"filename\"\n onChange={this.handleChange}\n ref=\"filepath\"\n />\n </fieldset>\n <fieldset className=\"file-type\">\n <legend>File Type</legend>\n <select\n id=\"extn\"\n defaultValue={ext}\n onChange={this.handleChange}\n ref=\"extname\"\n >\n <option value=\".yml\">YAML</option>\n <option value=\".json\">JSON</option>\n </select>\n </fieldset>\n </form>\n );\n }\n\n render() {\n const { fields, slug, ext, restricted } = this.props;\n return (\n <div>\n <div className=\"warning\">\n CAUTION! Any existing comments will be lost when editing via this\n view. Switch to the <strong>Raw Editor</strong> to preserve them.\n </div>\n {!restricted && this.renderPathFields(slug, ext)}\n <MetaFields fields={fields} dataview />\n </div>\n );\n }\n}\n\nDataGUI.defaultProps = {\n fields: {},\n slug: '',\n ext: '',\n restricted: false,\n};\n\nDataGUI.propTypes = {\n onChange: PropTypes.func.isRequired,\n fields: PropTypes.object,\n slug: PropTypes.string,\n ext: PropTypes.string,\n restricted: PropTypes.bool,\n};\n\nexport default DataGUI;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport AceEditor from 'react-ace';\nimport 'brace/mode/json';\nimport 'brace/mode/yaml';\nimport 'brace/theme/monokai';\n\nclass Editor extends Component {\n shouldComponentUpdate(nextProps, nextState) {\n return nextProps.content !== this.props.content;\n }\n\n handleChange = () => {\n const { onEditorChange, editorChanged } = this.props;\n !editorChanged && onEditorChange();\n };\n\n getValue() {\n return this.refs.ace.editor.getValue();\n }\n\n render() {\n const { content, type } = this.props;\n const mode = /json/i.test(type) ? 'json' : 'yaml';\n return (\n <div>\n <AceEditor\n value={content}\n mode={mode}\n theme=\"monokai\"\n width=\"100%\"\n height=\"400px\"\n showGutter={false}\n showPrintMargin={false}\n highlightActiveLine={false}\n className=\"config-editor\"\n fontSize={14}\n scrollMargin={[15, 15, 15, 15]}\n ref=\"ace\"\n onChange={this.handleChange}\n />\n <div className=\"statusbar\">mode: {mode.toUpperCase()}</div>\n </div>\n );\n }\n}\n\nEditor.propTypes = {\n content: PropTypes.any.isRequired,\n onEditorChange: PropTypes.func.isRequired,\n editorChanged: PropTypes.bool.isRequired,\n type: PropTypes.string,\n};\n\nexport default Editor;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport _ from 'underscore';\n\nconst Errors = ({ errors }) => (\n <div className=\"error-messages\">\n {_.map(errors, (error, i) => <div key={i}>{error}</div>)}\n </div>\n);\n\nErrors.propTypes = {\n errors: PropTypes.array.isRequired,\n};\n\nexport default Errors;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport Icon from './Icon';\n\nimport translations from '../translations';\nconst { labels } = translations;\n\nconst iconMap = {\n create: 'plus-square',\n delete: 'trash',\n publish: 'send-o',\n save: 'save',\n upload: 'upload',\n view: 'eye',\n};\n\nexport default function Button({\n type,\n active,\n triggered,\n onClick,\n block,\n thin,\n icon,\n to,\n}) {\n const btnClass = classnames('btn', {\n 'btn-active': active,\n 'btn-success': active && (type === 'save' || type === 'create'),\n 'btn-delete': type === 'delete',\n 'btn-view': type === 'view' || type === 'publish',\n 'btn-inactive': !active,\n 'btn-fat': block,\n 'btn-thin': thin,\n });\n\n let label, triggeredLabel;\n switch (type) {\n case 'save':\n case 'create':\n label = labels[type].label;\n triggeredLabel = labels[type].triggeredLabel;\n break;\n case 'view-toggle':\n label = labels.viewToggle.label;\n triggeredLabel = labels.viewToggle.triggeredLabel;\n break;\n case 'view':\n case 'delete':\n case 'upload':\n case 'publish':\n label = labels[type].label;\n break;\n default:\n label = '<LABEL>';\n triggeredLabel = '<NEXT LABEL>';\n }\n\n const iconName = icon || iconMap[type];\n const iconNode = iconName && <Icon name={iconName} />;\n\n if (to) {\n return (\n <a href={to} target=\"_blank\" rel=\"noopener noreferrer\" className={btnClass}>\n {iconNode}\n {label}\n </a>\n );\n } else if (onClick) {\n return (\n <button onClick={onClick} className={btnClass}>\n {iconNode}\n {triggered ? triggeredLabel : label}\n </button>\n );\n }\n\n return null;\n}\n\nButton.propTypes = {\n type: PropTypes.string.isRequired,\n active: PropTypes.bool.isRequired,\n onClick: PropTypes.func,\n triggered: PropTypes.bool,\n block: PropTypes.bool,\n thin: PropTypes.bool,\n icon: PropTypes.string,\n to: PropTypes.string,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { withRouter } from 'react-router';\nimport { HotKeys } from 'react-hotkeys';\nimport DocumentTitle from 'react-document-title';\nimport DataGUI from '../../components/DataGUI';\nimport Editor from '../../components/Editor';\nimport Errors from '../../components/Errors';\nimport Button from '../../components/Button';\nimport { putConfig, onEditorChange } from '../../ducks/config';\nimport { clearErrors } from '../../ducks/utils';\nimport { preventDefault } from '../../utils/helpers';\n\nimport translations from '../../translations';\nconst { getLeaveMessage } = translations;\n\nexport class Configuration extends Component {\n state = {\n guiView: false,\n };\n\n componentDidMount() {\n const { router, route } = this.props;\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n const { editorChanged, fieldChanged } = this.props;\n if (editorChanged || fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n toggleView = () => {\n this.setState(state => {\n return { guiView: !state.guiView };\n });\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { editorChanged, fieldChanged, putConfig } = this.props;\n if (editorChanged) {\n const value = this.refs.editor.getValue();\n putConfig(value);\n } else if (fieldChanged) {\n putConfig(null, 'gui');\n }\n };\n\n renderContentBody() {\n const { config, editorChanged, onEditorChange } = this.props;\n const { raw_content, content } = config;\n\n if (this.state.guiView && content) {\n return <DataGUI fields={content} onChange={onEditorChange} restricted />;\n }\n\n return (\n <Editor\n editorChanged={editorChanged}\n onEditorChange={onEditorChange}\n content={raw_content}\n ref=\"editor\"\n />\n );\n }\n\n render() {\n const { editorChanged, fieldChanged, updated, errors } = this.props;\n\n const keyboardHandlers = {\n save: this.handleClickSave,\n };\n\n return (\n <DocumentTitle title=\"Configuration\">\n <HotKeys handlers={keyboardHandlers} className=\"single\">\n {errors && errors.length > 0 && <Errors errors={errors} />}\n <div className=\"content-header\">\n <h1>Configuration</h1>\n <div className=\"page-buttons multiple\">\n <Button\n onClick={this.toggleView}\n type=\"view-toggle\"\n triggered={this.state.guiView}\n active\n block\n />\n <Button\n onClick={this.handleClickSave}\n type=\"save\"\n active={editorChanged || fieldChanged}\n triggered={updated}\n block\n />\n </div>\n </div>\n <div className=\"content-body\">{this.renderContentBody()}</div>\n </HotKeys>\n </DocumentTitle>\n );\n }\n}\n\nConfiguration.propTypes = {\n config: PropTypes.object.isRequired,\n onEditorChange: PropTypes.func.isRequired,\n putConfig: PropTypes.func.isRequired,\n updated: PropTypes.bool.isRequired,\n editorChanged: PropTypes.bool.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n errors: PropTypes.array.isRequired,\n clearErrors: PropTypes.func.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n config: state.config.config,\n updated: state.config.updated,\n editorChanged: state.config.editorChanged,\n fieldChanged: state.metadata.fieldChanged,\n errors: state.utils.errors,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators({ putConfig, onEditorChange, clearErrors }, dispatch);\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(Configuration)\n);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { browserHistory, Link } from 'react-router';\nimport Breadcrumbs from './Breadcrumbs';\nimport Button from './Button';\nimport Icon from './Icon';\nimport InputSearch from './form/InputSearch';\nimport { ADMIN_PREFIX } from '../constants';\n\nimport translations from '../translations';\nconst { getDeleteMessage, getNotFoundMessage } = translations;\n\nexport default class Explorer extends Component {\n handleClickDelete(filename) {\n const { deleteItem, params, type } = this.props;\n const confirm = window.confirm(getDeleteMessage(filename));\n const dir = params.splat ? `/${params.splat}` : '';\n if (confirm) {\n deleteItem(params.splat, filename);\n browserHistory.push(`${ADMIN_PREFIX}/${type}${dir}`);\n }\n }\n\n renderTitleCell(name, icon, type, path) {\n return (\n <td className=\"row-title\">\n <strong>\n <Link to={`${ADMIN_PREFIX}/${type}/${path}`}>\n <Icon name={icon} />\n {name}\n </Link>\n </strong>\n </td>\n );\n }\n\n renderDirectoryRow(directory, type, index) {\n const { name, relative_path } = directory;\n return (\n <tr key={index}>\n {this.renderTitleCell(name, 'folder', type, relative_path)}\n <td />\n </tr>\n );\n }\n\n renderFileRow(file, type, index) {\n const { name, relative_path, http_url } = file;\n return (\n <tr key={index}>\n {this.renderTitleCell(name, 'file-text-o', type, relative_path)}\n <td>\n <div className=\"row-actions\">\n <Button\n onClick={() => this.handleClickDelete(name)}\n type=\"delete\"\n active\n thin\n />\n {http_url && <Button to={http_url} type=\"view\" active thin />}\n </div>\n </td>\n </tr>\n );\n }\n\n renderRows() {\n const { items, type } = this.props;\n return items.map((entry, index) =>\n entry.type === 'directory'\n ? this.renderDirectoryRow(entry, type, index)\n : this.renderFileRow(entry, type, index)\n );\n }\n\n render() {\n const { items, type, newBtnLabel, search, params } = this.props;\n const typeLabel = type === 'datafiles' ? 'data files' : type;\n\n const to = params.splat\n ? `${ADMIN_PREFIX}/${type}/${params.splat}/new`\n : `${ADMIN_PREFIX}/${type}/new`;\n\n const content = items.length ? (\n <div className=\"content-table\">\n <table>\n <thead>\n <tr>\n <th>Filename</th>\n <th className=\"th-actions\">Actions</th>\n </tr>\n </thead>\n <tbody>{this.renderRows()}</tbody>\n </table>\n </div>\n ) : (\n <h1>{getNotFoundMessage(typeLabel)}</h1>\n );\n\n return (\n <div>\n <div className=\"content-header\">\n <Breadcrumbs type={type} splat={params.splat} />\n <div className=\"page-buttons\">\n <Link className=\"btn btn-active\" to={to}>\n {newBtnLabel}\n </Link>\n </div>\n <div className=\"pull-right\">\n <InputSearch searchBy=\"filename\" search={search} />\n </div>\n </div>\n {content}\n </div>\n );\n }\n}\n\nExplorer.propTypes = {\n type: PropTypes.string.isRequired,\n items: PropTypes.array.isRequired,\n params: PropTypes.object.isRequired,\n newBtnLabel: PropTypes.string.isRequired,\n deleteItem: PropTypes.func.isRequired,\n search: PropTypes.func.isRequired,\n};\n","import { clearErrors, validationError, filterDeleted } from './utils';\nimport { get, put, del } from '../utils/fetch';\nimport { validatePage } from '../utils/validation';\nimport {\n slugify,\n preparePayload,\n sanitizeFrontMatter,\n computeRelativePath,\n} from '../utils/helpers';\nimport { pagesAPIUrl, pageAPIUrl } from '../constants/api';\n\n// Action Types\nexport const FETCH_PAGES_REQUEST = 'FETCH_PAGES_REQUEST';\nexport const FETCH_PAGES_SUCCESS = 'FETCH_PAGES_SUCCESS';\nexport const FETCH_PAGES_FAILURE = 'FETCH_PAGES_FAILURE';\nexport const FETCH_PAGE_REQUEST = 'FETCH_PAGE_REQUEST';\nexport const FETCH_PAGE_SUCCESS = 'FETCH_PAGE_SUCCESS';\nexport const FETCH_PAGE_FAILURE = 'FETCH_PAGE_FAILURE';\nexport const PUT_PAGE_REQUEST = 'PUT_PAGE_REQUEST';\nexport const PUT_PAGE_SUCCESS = 'PUT_PAGE_SUCCESS';\nexport const PUT_PAGE_FAILURE = 'PUT_PAGE_FAILURE';\nexport const DELETE_PAGE_REQUEST = 'DELETE_PAGE_REQUEST';\nexport const DELETE_PAGE_SUCCESS = 'DELETE_PAGE_SUCCESS';\nexport const DELETE_PAGE_FAILURE = 'DELETE_PAGE_FAILURE';\n\n// Actions\nexport const fetchPages = (directory = '') => dispatch => {\n dispatch({ type: FETCH_PAGES_REQUEST });\n return get(\n pagesAPIUrl(directory),\n { type: FETCH_PAGES_SUCCESS, name: 'pages' },\n { type: FETCH_PAGES_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const fetchPage = (directory, filename) => dispatch => {\n dispatch({ type: FETCH_PAGE_REQUEST });\n return get(\n pageAPIUrl(directory, filename),\n { type: FETCH_PAGE_SUCCESS, name: 'page' },\n { type: FETCH_PAGE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const createPage = directory => (dispatch, getState) => {\n // get edited fields from metadata state\n const metadata = getState().metadata.metadata;\n let { path, raw_content, title } = metadata;\n // if `path` is a falsy value or if appending a slash to it equals to\n // `directory`, generate filename from `title`.\n if ((!path || `${path}/` === directory) && title) {\n path = `${slugify(title)}.md`;\n } else {\n const errors = validatePage(metadata);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n }\n // clear errors\n dispatch(clearErrors());\n\n const front_matter = sanitizeFrontMatter(metadata);\n\n // send the put request\n return put(\n pageAPIUrl(directory, path),\n preparePayload({ front_matter, raw_content }),\n { type: PUT_PAGE_SUCCESS, name: 'page' },\n { type: PUT_PAGE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const putPage = (directory, filename) => (dispatch, getState) => {\n // get edited fields from metadata state\n const metadata = getState().metadata.metadata;\n let { path, raw_content, title } = metadata;\n // if `path` is a falsy value or if appending a slash to it equals to\n // `directory`, generate filename from `title`.\n if ((!path || `${path}/` === directory) && title) {\n path = `${slugify(title)}.md`;\n } else {\n const errors = validatePage(metadata);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n }\n // clear errors\n dispatch(clearErrors());\n\n const front_matter = sanitizeFrontMatter(metadata);\n const relative_path = directory ? `${directory}/${path}` : path;\n\n // send the put request\n return put(\n pageAPIUrl(directory, filename),\n preparePayload({ path: relative_path, front_matter, raw_content }),\n { type: PUT_PAGE_SUCCESS, name: 'page' },\n { type: PUT_PAGE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const deletePage = (directory, filename) => dispatch => {\n const relative_path = computeRelativePath(directory, filename);\n return del(\n pageAPIUrl(directory, filename),\n { type: DELETE_PAGE_SUCCESS, name: 'page', id: relative_path },\n { type: DELETE_PAGE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\n// Reducer\nexport default function pages(\n state = {\n pages: [],\n page: {},\n isFetching: false,\n updated: false,\n },\n action\n) {\n switch (action.type) {\n case FETCH_PAGES_REQUEST:\n case FETCH_PAGE_REQUEST:\n return {\n ...state,\n isFetching: true,\n };\n case FETCH_PAGES_SUCCESS:\n return {\n ...state,\n pages: action.pages,\n isFetching: false,\n page: {},\n };\n case FETCH_PAGES_FAILURE:\n return {\n ...state,\n isFetching: false,\n pages: [],\n };\n case FETCH_PAGE_SUCCESS:\n return {\n ...state,\n page: action.page,\n isFetching: false,\n };\n case FETCH_PAGE_FAILURE:\n return {\n ...state,\n page: {},\n isFetching: false,\n };\n case PUT_PAGE_SUCCESS:\n return {\n ...state,\n page: action.page,\n updated: true,\n };\n case DELETE_PAGE_SUCCESS:\n return {\n ...state,\n pages: filterDeleted(state.pages, action.id),\n };\n default:\n return {\n ...state,\n updated: false,\n };\n }\n}\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport DocumentTitle from 'react-document-title';\nimport Explorer from '../../components/Explorer';\nimport { search, filterBySearchInput } from '../../ducks/utils';\nimport { fetchPages, deletePage } from '../../ducks/pages';\nimport { getDocumentTitle } from '../../utils/helpers';\n\nexport class Pages extends Component {\n componentDidMount() {\n const { fetchPages, params } = this.props;\n fetchPages(params.splat);\n }\n\n componentWillReceiveProps(nextProps) {\n const { fetchPages } = nextProps;\n if (this.props.params.splat !== nextProps.params.splat) {\n fetchPages(nextProps.params.splat);\n }\n }\n\n render() {\n const { isFetching, pages, search, params, deletePage } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n const title = getDocumentTitle('pages', params.splat);\n\n return (\n <DocumentTitle title={title}>\n <Explorer\n type=\"pages\"\n items={pages}\n params={params}\n newBtnLabel=\"New page\"\n search={search}\n deleteItem={deletePage}\n />\n </DocumentTitle>\n );\n }\n}\n\nPages.propTypes = {\n pages: PropTypes.array.isRequired,\n fetchPages: PropTypes.func.isRequired,\n deletePage: PropTypes.func.isRequired,\n isFetching: PropTypes.bool.isRequired,\n search: PropTypes.func.isRequired,\n params: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n pages: filterBySearchInput(state.pages.pages, state.utils.input),\n isFetching: state.pages.isFetching,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchPages,\n deletePage,\n search,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Pages);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport TextareaAutosize from 'react-textarea-autosize';\nimport moment from 'moment';\nimport Icon from '../Icon';\n\nexport default class InputFilename extends Component {\n handleChange = e => {\n const { onChange } = this.props;\n\n // The `TextareaAutosize` has a `value` attribute\n // which is supposed to be set to its inner `TextArea`'s value\n // but is always undefined\n // So this is a workaround\n this.refs.input.value = e.target.value;\n\n onChange(e.target.value);\n };\n\n render() {\n const { path, type } = this.props;\n\n let placeholder = 'example.md';\n if (type === 'posts') {\n const date = moment().format('YYYY-MM-DD');\n placeholder = `${date}-your-title.md`;\n } else if (type === 'data files') {\n placeholder = 'your-filename.yml';\n }\n\n let tooltip = null;\n if (type !== 'data files') {\n tooltip = (\n <span className=\"tooltip\">\n <Icon name=\"info-circle\" />\n <span className=\"tooltip-text\">\n If you leave <b>path</b> blank, it will be autogenerated from title.\n </span>\n </span>\n );\n }\n return (\n <div className=\"input-path\">\n <label>Path {tooltip}</label>\n <TextareaAutosize\n key={path}\n onChange={this.handleChange}\n placeholder={placeholder}\n defaultValue={path}\n ref=\"input\"\n />\n </div>\n );\n }\n}\n\nInputFilename.propTypes = {\n path: PropTypes.string.isRequired,\n type: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport TextareaAutosize from 'react-textarea-autosize';\n\nexport default class InputTitle extends Component {\n shouldComponentUpdate(nextProps) {\n return nextProps.title !== this.props.title;\n }\n\n handleChange = e => {\n const { onChange } = this.props;\n onChange(e.target.value);\n };\n\n render() {\n const { title } = this.props;\n return (\n <div className=\"input-title\">\n <label>Title</label>\n <TextareaAutosize\n onChange={this.handleChange}\n placeholder=\"Title\"\n defaultValue={title}\n ref=\"input\"\n />\n </div>\n );\n }\n}\n\nInputTitle.propTypes = {\n title: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n};\n","/* eslint-disable */\n\nimport hljs from 'highlight.js/lib/highlight';\n\n// ---\n// Languages supported as of highlight.js v9.17.1.\n//\n// We can't have a dynamic require statement below because webpack doesn't\n// evaluate statements and will therefore include all languages in the final\n// bundle unless webpack is additionally configured to not include the languages\n// we don't intend to include.\n// ---\n\nhljs.registerLanguage('actionscript', require('highlight.js/lib/languages/actionscript'));\nhljs.registerLanguage('apache', require('highlight.js/lib/languages/apache'));\nhljs.registerLanguage('applescript', require('highlight.js/lib/languages/applescript'));\nhljs.registerLanguage('asciidoc', require('highlight.js/lib/languages/asciidoc'));\nhljs.registerLanguage('bash', require('highlight.js/lib/languages/bash'));\nhljs.registerLanguage('basic', require('highlight.js/lib/languages/basic'));\nhljs.registerLanguage('clojure', require('highlight.js/lib/languages/clojure'));\nhljs.registerLanguage('clojure-repl', require('highlight.js/lib/languages/clojure-repl'));\nhljs.registerLanguage('cmake', require('highlight.js/lib/languages/cmake'));\nhljs.registerLanguage('coffeescript', require('highlight.js/lib/languages/coffeescript'));\nhljs.registerLanguage('cpp', require('highlight.js/lib/languages/cpp'));\nhljs.registerLanguage('crystal', require('highlight.js/lib/languages/crystal'));\nhljs.registerLanguage('css', require('highlight.js/lib/languages/css'));\nhljs.registerLanguage('dart', require('highlight.js/lib/languages/dart'));\nhljs.registerLanguage('diff', require('highlight.js/lib/languages/diff'));\nhljs.registerLanguage('django', require('highlight.js/lib/languages/django'));\nhljs.registerLanguage('dns', require('highlight.js/lib/languages/dns'));\nhljs.registerLanguage('dockerfile', require('highlight.js/lib/languages/dockerfile'));\nhljs.registerLanguage('dos', require('highlight.js/lib/languages/dos'));\nhljs.registerLanguage('dsconfig', require('highlight.js/lib/languages/dsconfig'));\nhljs.registerLanguage('elixir', require('highlight.js/lib/languages/elixir'));\nhljs.registerLanguage('elm', require('highlight.js/lib/languages/elm'));\nhljs.registerLanguage('erb', require('highlight.js/lib/languages/erb'));\nhljs.registerLanguage('erlang-repl', require('highlight.js/lib/languages/erlang-repl'));\nhljs.registerLanguage('erlang', require('highlight.js/lib/languages/erlang'));\nhljs.registerLanguage('excel', require('highlight.js/lib/languages/excel'));\nhljs.registerLanguage('fortran', require('highlight.js/lib/languages/fortran'));\nhljs.registerLanguage('fsharp', require('highlight.js/lib/languages/fsharp'));\nhljs.registerLanguage('gherkin', require('highlight.js/lib/languages/gherkin'));\nhljs.registerLanguage('go', require('highlight.js/lib/languages/go'));\nhljs.registerLanguage('gradle', require('highlight.js/lib/languages/gradle'));\nhljs.registerLanguage('groovy', require('highlight.js/lib/languages/groovy'));\nhljs.registerLanguage('haml', require('highlight.js/lib/languages/haml'));\nhljs.registerLanguage('handlebars', require('highlight.js/lib/languages/handlebars'));\nhljs.registerLanguage('haskell', require('highlight.js/lib/languages/haskell'));\nhljs.registerLanguage('htmlbars', require('highlight.js/lib/languages/htmlbars'));\nhljs.registerLanguage('http', require('highlight.js/lib/languages/http'));\nhljs.registerLanguage('ini', require('highlight.js/lib/languages/ini'));\nhljs.registerLanguage('java', require('highlight.js/lib/languages/java'));\nhljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'));\nhljs.registerLanguage('json', require('highlight.js/lib/languages/json'));\nhljs.registerLanguage('julia', require('highlight.js/lib/languages/julia'));\nhljs.registerLanguage('julia-repl', require('highlight.js/lib/languages/julia-repl'));\nhljs.registerLanguage('kotlin', require('highlight.js/lib/languages/kotlin'));\nhljs.registerLanguage('ldif', require('highlight.js/lib/languages/ldif'));\nhljs.registerLanguage('less', require('highlight.js/lib/languages/less'));\nhljs.registerLanguage('lisp', require('highlight.js/lib/languages/lisp'));\nhljs.registerLanguage('livescript', require('highlight.js/lib/languages/livescript'));\nhljs.registerLanguage('lua', require('highlight.js/lib/languages/lua'));\nhljs.registerLanguage('makefile', require('highlight.js/lib/languages/makefile'));\nhljs.registerLanguage('markdown', require('highlight.js/lib/languages/markdown'));\nhljs.registerLanguage('mathematica', require('highlight.js/lib/languages/mathematica'));\nhljs.registerLanguage('matlab', require('highlight.js/lib/languages/matlab'));\nhljs.registerLanguage('perl', require('highlight.js/lib/languages/perl'));\nhljs.registerLanguage('nginx', require('highlight.js/lib/languages/nginx'));\nhljs.registerLanguage('nix', require('highlight.js/lib/languages/nix'));\nhljs.registerLanguage('objectivec', require('highlight.js/lib/languages/objectivec'));\nhljs.registerLanguage('ocaml', require('highlight.js/lib/languages/ocaml'));\nhljs.registerLanguage('pgsql', require('highlight.js/lib/languages/pgsql'));\nhljs.registerLanguage('php', require('highlight.js/lib/languages/php'));\nhljs.registerLanguage('plaintext', require('highlight.js/lib/languages/plaintext'));\nhljs.registerLanguage('powershell', require('highlight.js/lib/languages/powershell'));\nhljs.registerLanguage('prolog', require('highlight.js/lib/languages/prolog'));\nhljs.registerLanguage('python', require('highlight.js/lib/languages/python'));\nhljs.registerLanguage('r', require('highlight.js/lib/languages/r'));\nhljs.registerLanguage('reasonml', require('highlight.js/lib/languages/reasonml'));\nhljs.registerLanguage('ruby', require('highlight.js/lib/languages/ruby'));\nhljs.registerLanguage('rust', require('highlight.js/lib/languages/rust'));\nhljs.registerLanguage('scala', require('highlight.js/lib/languages/scala'));\nhljs.registerLanguage('scss', require('highlight.js/lib/languages/scss'));\nhljs.registerLanguage('shell', require('highlight.js/lib/languages/shell'));\nhljs.registerLanguage('smalltalk', require('highlight.js/lib/languages/smalltalk'));\nhljs.registerLanguage('sql', require('highlight.js/lib/languages/sql'));\nhljs.registerLanguage('swift', require('highlight.js/lib/languages/swift'));\nhljs.registerLanguage('typescript', require('highlight.js/lib/languages/typescript'));\nhljs.registerLanguage('vbnet', require('highlight.js/lib/languages/vbnet'));\nhljs.registerLanguage('vbscript', require('highlight.js/lib/languages/vbscript'));\nhljs.registerLanguage('vim', require('highlight.js/lib/languages/vim'));\nhljs.registerLanguage('yaml', require('highlight.js/lib/languages/yaml'));\nhljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));\n\n// ---\n// Uncomment below to include that language in the final build\n// ---\n\n// hljs.registerLanguage('1c', require('highlight.js/lib/languages/1c'));\n// hljs.registerLanguage('abnf', require('highlight.js/lib/languages/abnf'));\n// hljs.registerLanguage('accesslog', require('highlight.js/lib/languages/accesslog'));\n// hljs.registerLanguage('ada', require('highlight.js/lib/languages/ada'));\n// hljs.registerLanguage('angelscript', require('highlight.js/lib/languages/angelscript'));\n// hljs.registerLanguage('arcade', require('highlight.js/lib/languages/arcade'));\n// hljs.registerLanguage('arduino', require('highlight.js/lib/languages/arduino'));\n// hljs.registerLanguage('armasm', require('highlight.js/lib/languages/armasm'));\n// hljs.registerLanguage('aspectj', require('highlight.js/lib/languages/aspectj'));\n// hljs.registerLanguage('autohotkey', require('highlight.js/lib/languages/autohotkey'));\n// hljs.registerLanguage('autoit', require('highlight.js/lib/languages/autoit'));\n// hljs.registerLanguage('avrasm', require('highlight.js/lib/languages/avrasm'));\n// hljs.registerLanguage('awk', require('highlight.js/lib/languages/awk'));\n// hljs.registerLanguage('axapta', require('highlight.js/lib/languages/axapta'));\n// hljs.registerLanguage('bnf', require('highlight.js/lib/languages/bnf'));\n// hljs.registerLanguage('brainfuck', require('highlight.js/lib/languages/brainfuck'));\n// hljs.registerLanguage('cal', require('highlight.js/lib/languages/cal'));\n// hljs.registerLanguage('capnproto', require('highlight.js/lib/languages/capnproto'));\n// hljs.registerLanguage('ceylon', require('highlight.js/lib/languages/ceylon'));\n// hljs.registerLanguage('clean', require('highlight.js/lib/languages/clean'));\n// hljs.registerLanguage('coq', require('highlight.js/lib/languages/coq'));\n// hljs.registerLanguage('cos', require('highlight.js/lib/languages/cos'));\n// hljs.registerLanguage('crmsh', require('highlight.js/lib/languages/crmsh'));\n// hljs.registerLanguage('cs', require('highlight.js/lib/languages/cs'));\n// hljs.registerLanguage('csp', require('highlight.js/lib/languages/csp'));\n// hljs.registerLanguage('d', require('highlight.js/lib/languages/d'));\n// hljs.registerLanguage('delphi', require('highlight.js/lib/languages/delphi'));\n// hljs.registerLanguage('dts', require('highlight.js/lib/languages/dts'));\n// hljs.registerLanguage('dust', require('highlight.js/lib/languages/dust'));\n// hljs.registerLanguage('ebnf', require('highlight.js/lib/languages/ebnf'));\n// hljs.registerLanguage('fix', require('highlight.js/lib/languages/fix'));\n// hljs.registerLanguage('flix', require('highlight.js/lib/languages/flix'));\n// hljs.registerLanguage('gams', require('highlight.js/lib/languages/gams'));\n// hljs.registerLanguage('gauss', require('highlight.js/lib/languages/gauss'));\n// hljs.registerLanguage('gcode', require('highlight.js/lib/languages/gcode'));\n// hljs.registerLanguage('glsl', require('highlight.js/lib/languages/glsl'));\n// hljs.registerLanguage('gml', require('highlight.js/lib/languages/gml'));\n// hljs.registerLanguage('golo', require('highlight.js/lib/languages/golo'));\n// hljs.registerLanguage('haxe', require('highlight.js/lib/languages/haxe'));\n// hljs.registerLanguage('hsp', require('highlight.js/lib/languages/hsp'));\n// hljs.registerLanguage('hy', require('highlight.js/lib/languages/hy'));\n// hljs.registerLanguage('inform7', require('highlight.js/lib/languages/inform7'));\n// hljs.registerLanguage('irpf90', require('highlight.js/lib/languages/irpf90'));\n// hljs.registerLanguage('isbl', require('highlight.js/lib/languages/isbl'));\n// hljs.registerLanguage('jboss-cli', require('highlight.js/lib/languages/jboss-cli'));\n// hljs.registerLanguage('lasso', require('highlight.js/lib/languages/lasso'));\n// hljs.registerLanguage('leaf', require('highlight.js/lib/languages/leaf'));\n// hljs.registerLanguage('livecodeserver', require('highlight.js/lib/languages/livecodeserver'));\n// hljs.registerLanguage('llvm', require('highlight.js/lib/languages/llvm'));\n// hljs.registerLanguage('lsl', require('highlight.js/lib/languages/lsl'));\n// hljs.registerLanguage('maxima', require('highlight.js/lib/languages/maxima'));\n// hljs.registerLanguage('mel', require('highlight.js/lib/languages/mel'));\n// hljs.registerLanguage('mercury', require('highlight.js/lib/languages/mercury'));\n// hljs.registerLanguage('mipsasm', require('highlight.js/lib/languages/mipsasm'));\n// hljs.registerLanguage('mizar', require('highlight.js/lib/languages/mizar'));\n// hljs.registerLanguage('mojolicious', require('highlight.js/lib/languages/mojolicious'));\n// hljs.registerLanguage('monkey', require('highlight.js/lib/languages/monkey'));\n// hljs.registerLanguage('moonscript', require('highlight.js/lib/languages/moonscript'));\n// hljs.registerLanguage('n1ql', require('highlight.js/lib/languages/n1ql'));\n// hljs.registerLanguage('nimrod', require('highlight.js/lib/languages/nimrod'));\n// hljs.registerLanguage('nsis', require('highlight.js/lib/languages/nsis'));\n// hljs.registerLanguage('openscad', require('highlight.js/lib/languages/openscad'));\n// hljs.registerLanguage('oxygene', require('highlight.js/lib/languages/oxygene'));\n// hljs.registerLanguage('parser3', require('highlight.js/lib/languages/parser3'));\n// hljs.registerLanguage('pf', require('highlight.js/lib/languages/pf'));\n// hljs.registerLanguage('pony', require('highlight.js/lib/languages/pony'));\n// hljs.registerLanguage('processing', require('highlight.js/lib/languages/processing'));\n// hljs.registerLanguage('profile', require('highlight.js/lib/languages/profile'));\n// hljs.registerLanguage('properties', require('highlight.js/lib/languages/properties'));\n// hljs.registerLanguage('protobuf', require('highlight.js/lib/languages/protobuf'));\n// hljs.registerLanguage('puppet', require('highlight.js/lib/languages/puppet'));\n// hljs.registerLanguage('purebasic', require('highlight.js/lib/languages/purebasic'));\n// hljs.registerLanguage('q', require('highlight.js/lib/languages/q'));\n// hljs.registerLanguage('qml', require('highlight.js/lib/languages/qml'));\n// hljs.registerLanguage('rib', require('highlight.js/lib/languages/rib'));\n// hljs.registerLanguage('roboconf', require('highlight.js/lib/languages/roboconf'));\n// hljs.registerLanguage('routeros', require('highlight.js/lib/languages/routeros'));\n// hljs.registerLanguage('rsl', require('highlight.js/lib/languages/rsl'));\n// hljs.registerLanguage('ruleslanguage', require('highlight.js/lib/languages/ruleslanguage'));\n// hljs.registerLanguage('sas', require('highlight.js/lib/languages/sas'));\n// hljs.registerLanguage('scheme', require('highlight.js/lib/languages/scheme'));\n// hljs.registerLanguage('scilab', require('highlight.js/lib/languages/scilab'));\n// hljs.registerLanguage('smali', require('highlight.js/lib/languages/smali'));\n// hljs.registerLanguage('sml', require('highlight.js/lib/languages/sml'));\n// hljs.registerLanguage('sqf', require('highlight.js/lib/languages/sqf'));\n// hljs.registerLanguage('stan', require('highlight.js/lib/languages/stan'));\n// hljs.registerLanguage('stata', require('highlight.js/lib/languages/stata'));\n// hljs.registerLanguage('step21', require('highlight.js/lib/languages/step21'));\n// hljs.registerLanguage('stylus', require('highlight.js/lib/languages/stylus'));\n// hljs.registerLanguage('subunit', require('highlight.js/lib/languages/subunit'));\n// hljs.registerLanguage('taggerscript', require('highlight.js/lib/languages/taggerscript'));\n// hljs.registerLanguage('tap', require('highlight.js/lib/languages/tap'));\n// hljs.registerLanguage('tcl', require('highlight.js/lib/languages/tcl'));\n// hljs.registerLanguage('tex', require('highlight.js/lib/languages/tex'));\n// hljs.registerLanguage('thrift', require('highlight.js/lib/languages/thrift'));\n// hljs.registerLanguage('tp', require('highlight.js/lib/languages/tp'));\n// hljs.registerLanguage('twig', require('highlight.js/lib/languages/twig'));\n// hljs.registerLanguage('vala', require('highlight.js/lib/languages/vala'));\n// hljs.registerLanguage('vbscript-html', require('highlight.js/lib/languages/vbscript-html'));\n// hljs.registerLanguage('verilog', require('highlight.js/lib/languages/verilog'));\n// hljs.registerLanguage('vhdl', require('highlight.js/lib/languages/vhdl'));\n// hljs.registerLanguage('x86asm', require('highlight.js/lib/languages/x86asm'));\n// hljs.registerLanguage('xl', require('highlight.js/lib/languages/xl'));\n// hljs.registerLanguage('xquery', require('highlight.js/lib/languages/xquery'));\n// hljs.registerLanguage('zephir', require('highlight.js/lib/languages/zephir'));\n\nexport default hljs;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport SimpleMDE from 'simplemde';\nimport hljs from '../utils/highlighter';\nimport FilePicker from './FilePicker';\nimport { getExtensionFromPath } from '../utils/helpers';\n\nconst classNames = [\n 'editor-toolbar',\n 'CodeMirror',\n 'editor-preview-side',\n 'editor-statusbar',\n];\n\nclass MarkdownEditor extends Component {\n componentDidMount() {\n this.create();\n window.hljs = hljs; // TODO: fix this after the next release of SimpleMDE\n }\n\n shouldComponentUpdate(nextProps) {\n return nextProps.initialValue !== this.props.initialValue;\n }\n\n componentDidUpdate() {\n this.destroy();\n this.create();\n }\n\n componentWillUnmount() {\n this.destroy();\n }\n\n create() {\n const { onChange, onSave } = this.props;\n let opts = Object.create(this.props);\n opts['element'] = this.refs.text;\n opts['autoDownloadFontAwesome'] = false;\n opts['spellChecker'] = false;\n opts['renderingConfig'] = {\n codeSyntaxHighlighting: true,\n };\n opts['insertTexts'] = {\n image: ['![', '](#url#)'],\n };\n let toolbarIcons = [\n 'bold',\n 'italic',\n 'heading',\n '|',\n 'code',\n 'quote',\n 'unordered-list',\n 'ordered-list',\n '|',\n 'link',\n 'image',\n 'table',\n {\n name: 'filepicker',\n action: () => this.refs.filepicker.refs.trigger.click(),\n className: 'fa fa-paperclip',\n title: 'Insert Static File',\n },\n '|',\n 'preview',\n 'side-by-side',\n 'fullscreen',\n '|',\n ];\n if (onSave) {\n toolbarIcons.push({\n name: 'save',\n action: onSave,\n className: 'fa fa-floppy-o',\n title: 'Save',\n });\n }\n opts['toolbar'] = toolbarIcons;\n const editor = new SimpleMDE(opts);\n if (editor.codemirror) {\n editor.codemirror.on('change', () => {\n onChange(editor.value());\n });\n }\n this.editor = editor;\n }\n\n destroy() {\n for (let i in classNames) {\n let elementToRemove = this.refs.container.querySelector(\n '.' + classNames[i]\n );\n elementToRemove && elementToRemove.remove();\n }\n }\n\n // Adapted from an internal helper function within SimpleMDE package.\n _replaceSelectedText = (cm, headNTail, url) => {\n const startPoint = cm.getCursor('start');\n const endPoint = cm.getCursor('end');\n const text = cm.getSelection();\n\n let [head, tail] = headNTail;\n if (url) {\n tail = tail.replace('#url#', url);\n }\n\n cm.replaceSelection(`${head}${text}${tail}`);\n startPoint.ch += head.length;\n\n if (startPoint !== endPoint) {\n endPoint.ch += head.length;\n }\n\n cm.setSelection(startPoint, endPoint);\n cm.focus();\n };\n\n handleFilePick = path => {\n const { codemirror, options } = this.editor;\n const { image, link } = options.insertTexts;\n const url = `{{ '${path}' | relative_url }}`;\n const ext = getExtensionFromPath(path);\n\n const type = /png|jpg|gif|jpeg|svg|ico/i.test(ext) ? image : link;\n this._replaceSelectedText(codemirror, type, url);\n };\n\n render() {\n return (\n <div>\n <div style={{ display: 'none' }}>\n <FilePicker ref=\"filepicker\" onPick={this.handleFilePick} />\n </div>\n <div ref=\"container\">\n <textarea ref=\"text\" />\n </div>\n </div>\n );\n }\n}\n\nMarkdownEditor.propTypes = {\n initialValue: PropTypes.string.isRequired,\n onChange: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n};\n\nexport default MarkdownEditor;\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport Splitter from './Splitter';\nimport InputPath from './form/InputPath';\nimport InputTitle from './form/InputTitle';\nimport MarkdownEditor from './MarkdownEditor';\nimport Metadata from '../containers/MetaFields';\n\nexport default function MarkdownPageBody({\n type,\n path,\n body,\n title,\n onSave,\n updateTitle,\n updatePath,\n updateBody,\n metafields,\n staticmetafields,\n}) {\n return (\n <div className=\"content-body\">\n <InputPath onChange={updatePath} type={type} path={path} />\n <InputTitle onChange={updateTitle} title={title} />\n <MarkdownEditor\n onChange={updateBody}\n onSave={onSave}\n placeholder=\"Body\"\n initialValue={body}\n />\n <Splitter />\n <Metadata fields={metafields} staticFields={staticmetafields} />\n </div>\n );\n}\n\nMarkdownPageBody.defaultProps = {\n path: '',\n body: '',\n title: '',\n metafields: {},\n staticmetafields: {},\n};\n\nMarkdownPageBody.propTypes = {\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n onSave: PropTypes.func.isRequired,\n type: PropTypes.string.isRequired,\n path: PropTypes.string,\n body: PropTypes.string,\n title: PropTypes.string,\n metafields: PropTypes.object,\n staticmetafields: PropTypes.object,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport { HotKeys } from 'react-hotkeys';\nimport _ from 'underscore';\nimport DocumentTitle from 'react-document-title';\nimport Button from '../../components/Button';\nimport Errors from '../../components/Errors';\nimport Splitter from '../../components/Splitter';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport MarkdownPageBody from '../../components/MarkdownPageBody';\nimport { fetchPage, deletePage, putPage } from '../../ducks/pages';\nimport { updateTitle, updateBody, updatePath } from '../../ducks/metadata';\nimport { clearErrors } from '../../ducks/utils';\nimport { preventDefault, getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getLeaveMessage, getDeleteMessage } = translations;\n\nexport class PageEdit extends Component {\n componentDidMount() {\n const { fetchPage, params, router, route } = this.props;\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n fetchPage(directory, filename);\n\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n const new_path = nextProps.page.path;\n const path = this.props.page.path;\n // redirect if the path is changed\n if (new_path !== path) {\n browserHistory.push(`${ADMIN_PREFIX}/pages/${new_path}`);\n }\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n if (this.props.fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { putPage, fieldChanged, params } = this.props;\n if (fieldChanged) {\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n putPage(directory, filename);\n }\n };\n\n handleClickDelete(name) {\n const { deletePage, params } = this.props;\n const confirm = window.confirm(getDeleteMessage(name));\n if (confirm) {\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n deletePage(directory, filename);\n browserHistory.push(`${ADMIN_PREFIX}/pages/${directory || ''}`);\n }\n }\n\n render() {\n const {\n isFetching,\n page,\n errors,\n updateTitle,\n updateBody,\n updatePath,\n updated,\n fieldChanged,\n params,\n } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n if (_.isEmpty(page)) {\n return <h1>{`Could not find the page.`}</h1>;\n }\n\n const keyboardHandlers = {\n save: this.handleClickSave,\n };\n\n const {\n name,\n raw_content,\n http_url,\n front_matter,\n front_matter_defaults,\n } = page;\n const directory = params.splat[0];\n\n const title = front_matter && front_matter.title ? front_matter.title : '';\n const document_title = getDocumentTitle('pages', directory, title || name);\n\n return (\n <DocumentTitle title={document_title}>\n <HotKeys handlers={keyboardHandlers} className=\"single\">\n {errors.length > 0 && <Errors errors={errors} />}\n\n <div className=\"content-header\">\n <Breadcrumbs type=\"pages\" splat={directory} />\n </div>\n\n <div className=\"content-wrapper\">\n <MarkdownPageBody\n type=\"pages\"\n updateTitle={updateTitle}\n updatePath={updatePath}\n updateBody={updateBody}\n onSave={this.handleClickSave}\n path={name}\n title={title}\n body={raw_content}\n metafields={{ title, raw_content, path: name, ...front_matter }}\n staticmetafields={front_matter_defaults}\n />\n <div className=\"content-side\">\n <Button\n onClick={this.handleClickSave}\n type=\"save\"\n active={fieldChanged}\n triggered={updated}\n block\n />\n <Button to={http_url} type=\"view\" active block />\n <Splitter />\n <Button\n onClick={() => this.handleClickDelete(name)}\n type=\"delete\"\n active\n block\n />\n </div>\n </div>\n </HotKeys>\n </DocumentTitle>\n );\n }\n}\n\nPageEdit.propTypes = {\n page: PropTypes.object.isRequired,\n fetchPage: PropTypes.func.isRequired,\n deletePage: PropTypes.func.isRequired,\n putPage: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n isFetching: PropTypes.bool.isRequired,\n errors: PropTypes.array.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n updated: PropTypes.bool.isRequired,\n params: PropTypes.object.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n page: state.pages.page,\n isFetching: state.pages.isFetching,\n fieldChanged: state.metadata.fieldChanged,\n updated: state.pages.updated,\n errors: state.utils.errors,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchPage,\n deletePage,\n putPage,\n updateTitle,\n updateBody,\n updatePath,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(PageEdit)\n);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { HotKeys } from 'react-hotkeys';\nimport Button from './Button';\nimport Errors from './Errors';\nimport Breadcrumbs from './Breadcrumbs';\nimport MarkdownPageBody from './MarkdownPageBody';\nimport { injectDefaultFields as defaultFields } from '../utils/metadata';\n\nexport default function CreateMarkdownPage({\n type,\n config,\n errors,\n updated,\n updateBody,\n updatePath,\n updateTitle,\n fieldChanged,\n onClickSave,\n params: { splat },\n}) {\n const metaType = type === 'drafts' ? 'posts' : type;\n\n return (\n <HotKeys handlers={{ save: onClickSave }}>\n {errors.length > 0 && <Errors errors={errors} />}\n\n <div className=\"content-header\">\n <Breadcrumbs type={type} splat={splat} />\n </div>\n\n <div className=\"content-wrapper\">\n <MarkdownPageBody\n type={type}\n updatePath={updatePath}\n updateTitle={updateTitle}\n updateBody={updateBody}\n onSave={onClickSave}\n staticmetafields={defaultFields(config, splat, metaType)}\n />\n <div className=\"content-side\">\n <Button\n onClick={onClickSave}\n type=\"create\"\n active={fieldChanged}\n triggered={updated}\n block\n />\n </div>\n </div>\n </HotKeys>\n );\n}\n\nCreateMarkdownPage.propTypes = {\n type: PropTypes.string.isRequired,\n config: PropTypes.object.isRequired,\n params: PropTypes.object.isRequired,\n errors: PropTypes.array.isRequired,\n updated: PropTypes.bool.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n onClickSave: PropTypes.func.isRequired,\n};\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport DocumentTitle from 'react-document-title';\nimport CreateMarkdownPage from '../../components/CreateMarkdownPage';\nimport { updateTitle, updateBody, updatePath } from '../../ducks/metadata';\nimport { createPage } from '../../ducks/pages';\nimport { clearErrors } from '../../ducks/utils';\nimport { preventDefault, getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getLeaveMessage } = translations;\n\nexport class PageNew extends Component {\n componentDidMount() {\n const { router, route } = this.props;\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n browserHistory.push(`${ADMIN_PREFIX}/pages/${nextProps.page.path}`);\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n if (this.props.fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { fieldChanged, createPage, params } = this.props;\n fieldChanged && createPage(params.splat);\n };\n\n render() {\n const {\n params,\n config,\n errors,\n updated,\n updateBody,\n updatePath,\n updateTitle,\n fieldChanged,\n } = this.props;\n\n const title = getDocumentTitle('pages', params.splat, 'New page');\n\n return (\n <DocumentTitle title={title}>\n <CreateMarkdownPage\n type=\"pages\"\n params={params}\n config={config}\n errors={errors}\n updated={updated}\n updateBody={updateBody}\n updatePath={updatePath}\n updateTitle={updateTitle}\n fieldChanged={fieldChanged}\n onClickSave={this.handleClickSave}\n />\n </DocumentTitle>\n );\n }\n}\n\nPageNew.propTypes = {\n createPage: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n errors: PropTypes.array.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n updated: PropTypes.bool.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n params: PropTypes.object.isRequired,\n config: PropTypes.object.isRequired,\n page: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n page: state.pages.page,\n fieldChanged: state.metadata.fieldChanged,\n errors: state.utils.errors,\n updated: state.pages.updated,\n config: state.config.config,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n updateTitle,\n updateBody,\n updatePath,\n createPage,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(PageNew)\n);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport _ from 'underscore';\nimport moment from 'moment';\nimport DocumentTitle from 'react-document-title';\nimport InputSearch from '../../components/form/InputSearch';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport Button from '../../components/Button';\nimport Icon from '../../components/Icon';\nimport {\n fetchCollection,\n deleteDocument,\n filterBySearchInput,\n} from '../../ducks/collections';\nimport { search } from '../../ducks/utils';\nimport { getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getDeleteMessage, getNotFoundMessage } = translations;\n\nexport class Documents extends Component {\n componentDidMount() {\n const { fetchCollection, params } = this.props;\n fetchCollection(params.collection_name, params.splat);\n }\n\n componentWillReceiveProps(nextProps) {\n const { fetchCollection, params } = nextProps;\n // refetch the collection when navigating between collections or when splat is changed\n if (\n params.splat !== this.props.params.splat ||\n params.collection_name !== this.props.params.collection_name\n ) {\n fetchCollection(params.collection_name, params.splat);\n }\n }\n\n handleClickDelete(filename) {\n const { deleteDocument, params } = this.props;\n const confirm = window.confirm(getDeleteMessage(filename));\n confirm && deleteDocument(params.collection_name, params.splat, filename);\n }\n\n renderTable() {\n return (\n <div className=\"content-table\">\n <table>\n <thead>\n <tr>\n <th>Name</th>\n <th>Date</th>\n <th className=\"th-actions\">Actions</th>\n </tr>\n </thead>\n <tbody>{this.renderRows()}</tbody>\n </table>\n </div>\n );\n }\n\n renderFileRow(doc) {\n const { id, name, title, http_url, collection, relative_path } = doc;\n const to = `${ADMIN_PREFIX}/collections/${collection}/${relative_path}`;\n // date w/o timezone\n let date = doc.date.substring(0, doc.date.lastIndexOf(' '));\n date =\n moment(date).format('hh:mm:ss') === '12:00:00'\n ? moment(date).format('ll')\n : moment(date).format('lll');\n\n return (\n <tr key={id}>\n <td className=\"row-title\">\n <strong>\n <Link to={to}>\n <Icon name=\"file-text-o\" />\n {title || name}\n </Link>\n </strong>\n </td>\n <td>{date}</td>\n <td>\n <div className=\"row-actions\">\n <Button\n onClick={() => this.handleClickDelete(name)}\n type=\"delete\"\n active\n thin\n />\n {http_url && <Button to={http_url} type=\"view\" active thin />}\n </div>\n </td>\n </tr>\n );\n }\n\n renderDirectoryRow(directory) {\n const { params: { collection_name } } = this.props;\n const { name, relative_path, modified_time } = directory;\n const to = `${ADMIN_PREFIX}/collections/${collection_name}/${relative_path}`;\n // date w/o timezone\n let date = modified_time.substring(0, modified_time.lastIndexOf(' '));\n date = moment(date).format('ll');\n return (\n <tr key={name}>\n <td className=\"row-title\">\n <strong>\n <Link to={to}>\n <Icon name=\"folder\" />\n {name}\n </Link>\n </strong>\n </td>\n <td>{date}</td>\n <td />\n </tr>\n );\n }\n\n renderRows() {\n const { documents } = this.props;\n return _.map(documents, entry => {\n if (entry.type && entry.type === 'directory') {\n return this.renderDirectoryRow(entry);\n } else {\n return this.renderFileRow(entry);\n }\n });\n }\n\n render() {\n const { isFetching, documents, search, params } = this.props;\n const { collection_name } = params;\n\n if (isFetching) {\n return null;\n }\n\n const splat = params.splat || '';\n const to = params.splat\n ? `${ADMIN_PREFIX}/collections/${collection_name}/${splat}/new`\n : `${ADMIN_PREFIX}/collections/${collection_name}/new`;\n\n const document_title = getDocumentTitle(collection_name, params.splat);\n\n return (\n <DocumentTitle title={document_title}>\n <div>\n <div className=\"content-header\">\n <Breadcrumbs type={collection_name} splat={splat} />\n <div className=\"page-buttons\">\n <Link className=\"btn btn-active\" to={to}>\n {collection_name === 'posts' ? 'New post' : 'New document'}\n </Link>\n </div>\n <div className=\"pull-right\">\n <InputSearch searchBy=\"title\" search={search} />\n </div>\n </div>\n {documents.length > 0 && this.renderTable()}\n {!documents.length && <h1>{getNotFoundMessage('documents')}</h1>}\n </div>\n </DocumentTitle>\n );\n }\n}\n\nDocuments.propTypes = {\n isFetching: PropTypes.bool.isRequired,\n documents: PropTypes.array.isRequired,\n fetchCollection: PropTypes.func.isRequired,\n deleteDocument: PropTypes.func.isRequired,\n search: PropTypes.func.isRequired,\n params: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n documents: filterBySearchInput(state.collections.entries, state.utils.input),\n isFetching: state.collections.isFetching,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchCollection,\n deleteDocument,\n search,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Documents);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport { HotKeys } from 'react-hotkeys';\nimport _ from 'underscore';\nimport DocumentTitle from 'react-document-title';\nimport Button from '../../components/Button';\nimport Errors from '../../components/Errors';\nimport Splitter from '../../components/Splitter';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport MarkdownPageBody from '../../components/MarkdownPageBody';\nimport {\n fetchDocument,\n deleteDocument,\n putDocument,\n} from '../../ducks/collections';\nimport { updateTitle, updateBody, updatePath } from '../../ducks/metadata';\nimport { clearErrors } from '../../ducks/utils';\nimport { preventDefault, getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getLeaveMessage, getDeleteMessage, getNotFoundMessage } = translations;\n\nexport class DocumentEdit extends Component {\n componentDidMount() {\n const { fetchDocument, params, router, route } = this.props;\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n fetchDocument(params.collection_name, directory, filename);\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillReceiveProps(nextProps) {\n const { currentDocument } = this.props;\n if (this.props.updated !== nextProps.updated) {\n const new_path = nextProps.currentDocument.path;\n const path = currentDocument.path;\n // redirect if the path is changed\n if (new_path !== path) {\n browserHistory.push(\n `${ADMIN_PREFIX}/collections/${new_path.substring(1)}` // remove `_`\n );\n }\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n if (this.props.fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { putDocument, fieldChanged, params } = this.props;\n if (fieldChanged) {\n const collection = params.collection_name;\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n putDocument(collection, directory, filename);\n }\n };\n\n handleClickDelete = () => {\n const { deleteDocument, params } = this.props;\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n const confirm = window.confirm(getDeleteMessage(filename));\n if (confirm) {\n const collection = params.collection_name;\n deleteDocument(collection, directory, filename);\n browserHistory.push(\n `${ADMIN_PREFIX}/collections/${collection}/${directory || ''}`\n );\n }\n };\n\n render() {\n const {\n isFetching,\n currentDocument,\n errors,\n updateTitle,\n updateBody,\n updatePath,\n updated,\n fieldChanged,\n params,\n } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n if (_.isEmpty(currentDocument)) {\n return <h1>{getNotFoundMessage('document')}</h1>;\n }\n\n const {\n title,\n raw_content,\n http_url,\n collection,\n front_matter,\n front_matter_defaults,\n name,\n } = currentDocument;\n const directory = params.splat[0];\n\n const keyboardHandlers = {\n save: this.handleClickSave,\n };\n\n const document_title = getDocumentTitle(collection, directory, title);\n\n return (\n <DocumentTitle title={document_title}>\n <HotKeys handlers={keyboardHandlers} className=\"single\">\n {errors.length > 0 && <Errors errors={errors} />}\n\n <div className=\"content-header\">\n <Breadcrumbs type={collection} splat={directory} />\n </div>\n\n <div className=\"content-wrapper\">\n <MarkdownPageBody\n type={collection}\n path={name}\n title={title}\n body={raw_content}\n updatePath={updatePath}\n updateTitle={updateTitle}\n updateBody={updateBody}\n onSave={this.handleClickSave}\n metafields={{ title, path: name, raw_content, ...front_matter }}\n staticmetafields={front_matter_defaults}\n />\n <div className=\"content-side\">\n <Button\n onClick={this.handleClickSave}\n type=\"save\"\n active={fieldChanged}\n triggered={updated}\n block\n />\n <Button to={http_url} type=\"view\" active block />\n <Splitter />\n <Button\n onClick={this.handleClickDelete}\n type=\"delete\"\n active\n block\n />\n </div>\n </div>\n </HotKeys>\n </DocumentTitle>\n );\n }\n}\n\nDocumentEdit.propTypes = {\n currentDocument: PropTypes.object.isRequired,\n fetchDocument: PropTypes.func.isRequired,\n deleteDocument: PropTypes.func.isRequired,\n putDocument: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n isFetching: PropTypes.bool.isRequired,\n errors: PropTypes.array.isRequired,\n updated: PropTypes.bool.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n params: PropTypes.object.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n currentDocument: state.collections.currentDocument,\n isFetching: state.collections.isFetching,\n fieldChanged: state.metadata.fieldChanged,\n updated: state.collections.updated,\n errors: state.utils.errors,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchDocument,\n deleteDocument,\n putDocument,\n updateTitle,\n updateBody,\n updatePath,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(DocumentEdit)\n);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport DocumentTitle from 'react-document-title';\nimport CreateMarkdownPage from '../../components/CreateMarkdownPage';\nimport { updateTitle, updateBody, updatePath } from '../../ducks/metadata';\nimport { createDocument } from '../../ducks/collections';\nimport { clearErrors } from '../../ducks/utils';\nimport { preventDefault, getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getLeaveMessage } = translations;\n\nexport class DocumentNew extends Component {\n componentDidMount() {\n const { router, route } = this.props;\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n const path = nextProps.currentDocument.path;\n const splat = path.substr(path.indexOf('/') + 1, path.length);\n browserHistory.push(\n `${ADMIN_PREFIX}/collections/${nextProps.currentDocument.collection}/${splat}`\n );\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n if (this.props.fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { fieldChanged, createDocument, params } = this.props;\n fieldChanged && createDocument(params.collection_name, params.splat);\n };\n\n render() {\n const {\n params,\n config,\n errors,\n updated,\n updateBody,\n updatePath,\n updateTitle,\n fieldChanged,\n } = this.props;\n\n const collection = params.collection_name;\n const title = getDocumentTitle(collection, params.splat, 'New document');\n\n return (\n <DocumentTitle title={title}>\n <CreateMarkdownPage\n type={collection}\n params={params}\n config={config}\n errors={errors}\n updated={updated}\n updateBody={updateBody}\n updatePath={updatePath}\n updateTitle={updateTitle}\n fieldChanged={fieldChanged}\n onClickSave={this.handleClickSave}\n />\n </DocumentTitle>\n );\n }\n}\n\nDocumentNew.propTypes = {\n createDocument: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n errors: PropTypes.array.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n updated: PropTypes.bool.isRequired,\n params: PropTypes.object.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n config: PropTypes.object.isRequired,\n currentDocument: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n currentDocument: state.collections.currentDocument,\n fieldChanged: state.metadata.fieldChanged,\n errors: state.utils.errors,\n updated: state.collections.updated,\n config: state.config.config,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n updateTitle,\n updateBody,\n updatePath,\n createDocument,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(DocumentNew)\n);\n","import { clearErrors, validationError, filterDeleted } from './utils';\nimport { get, put, del } from '../utils/fetch';\nimport { datafilesAPIUrl, datafileAPIUrl } from '../constants/api';\nimport {\n toYAML,\n trimObject,\n computeRelativePath,\n getExtensionFromPath,\n} from '../utils/helpers';\nimport { validator } from '../utils/validation';\n\nimport translations from '../translations';\nconst { getContentRequiredMessage, getFilenameRequiredMessage } = translations;\n\n// Action Types\nexport const FETCH_DATAFILES_REQUEST = 'FETCH_DATAFILES_REQUEST';\nexport const FETCH_DATAFILES_SUCCESS = 'FETCH_DATAFILES_SUCCESS';\nexport const FETCH_DATAFILES_FAILURE = 'FETCH_DATAFILES_FAILURE';\nexport const FETCH_DATAFILE_REQUEST = 'FETCH_DATAFILE_REQUEST';\nexport const FETCH_DATAFILE_SUCCESS = 'FETCH_DATAFILE_SUCCESS';\nexport const FETCH_DATAFILE_FAILURE = 'FETCH_DATAFILE_FAILURE';\nexport const PUT_DATAFILE_REQUEST = 'PUT_DATAFILE_REQUEST';\nexport const PUT_DATAFILE_SUCCESS = 'PUT_DATAFILE_SUCCESS';\nexport const PUT_DATAFILE_FAILURE = 'PUT_DATAFILE_FAILURE';\nexport const DELETE_DATAFILE_REQUEST = 'DELETE_DATAFILE_REQUEST';\nexport const DELETE_DATAFILE_SUCCESS = 'DELETE_DATAFILE_SUCCESS';\nexport const DELETE_DATAFILE_FAILURE = 'DELETE_DATAFILE_FAILURE';\nexport const DATAFILE_CHANGED = 'DATAFILE_CHANGED';\n\n// Actions\nexport const fetchDataFiles = (directory = '') => dispatch => {\n dispatch({ type: FETCH_DATAFILES_REQUEST });\n return get(\n datafilesAPIUrl(directory),\n { type: FETCH_DATAFILES_SUCCESS, name: 'files' },\n { type: FETCH_DATAFILES_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const fetchDataFile = (directory, filename) => dispatch => {\n dispatch({ type: FETCH_DATAFILE_REQUEST });\n return get(\n datafileAPIUrl(directory, filename),\n { type: FETCH_DATAFILE_SUCCESS, name: 'file' },\n { type: FETCH_DATAFILE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\n/**\n * Creates and updates a data file.\n * @param {String} directory : Dirname of data file\n * @param {String} filename : The data file\n * @param {Object} data : Content to be written to data file\n * @param {String} new_path : File path relative to config['source']\n * @param {String} source : Point of origin of file-content data.\n * Either the default `#brace-editor`, or `<DataGUI/>`\n */\nexport const putDataFile = (\n directory,\n filename,\n data,\n new_path = '',\n source = 'editor'\n) => (dispatch, getState) => {\n const ext = getExtensionFromPath(new_path || filename);\n\n if (source === 'gui') {\n const json = /json/i.test(ext);\n let metadata = getState().metadata.metadata;\n metadata = trimObject(metadata);\n data = json ? JSON.stringify(metadata, null, 2) : toYAML(metadata);\n }\n\n const payload = new_path\n ? { path: new_path, raw_content: data }\n : { raw_content: data };\n\n // handle errors\n const errors = validateDatafile(filename, data);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n dispatch(clearErrors());\n\n return put(\n datafileAPIUrl(directory, filename),\n JSON.stringify(payload),\n { type: PUT_DATAFILE_SUCCESS, name: 'file' },\n { type: PUT_DATAFILE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const deleteDataFile = (directory, filename) => dispatch => {\n const relative_path = computeRelativePath(directory, filename);\n return del(\n datafileAPIUrl(directory, filename),\n { type: DELETE_DATAFILE_SUCCESS, name: 'file', id: relative_path },\n { type: DELETE_DATAFILE_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const onDataFileChanged = () => ({\n type: DATAFILE_CHANGED,\n});\n\nconst validateDatafile = (filename, data) =>\n validator(\n { filename, data },\n { filename: 'required', data: 'required' },\n {\n 'filename.required': getFilenameRequiredMessage(),\n 'data.required': getContentRequiredMessage(),\n }\n );\n\n// Reducer\nexport default function datafiles(\n state = {\n files: [],\n currentFile: {},\n isFetching: false,\n updated: false,\n datafileChanged: false,\n fieldChanged: false,\n },\n action\n) {\n switch (action.type) {\n case FETCH_DATAFILES_REQUEST:\n case FETCH_DATAFILE_REQUEST:\n return {\n ...state,\n isFetching: true,\n };\n case FETCH_DATAFILES_SUCCESS:\n return {\n ...state,\n files: action.files,\n isFetching: false,\n currentFile: {},\n };\n case FETCH_DATAFILES_FAILURE:\n return {\n ...state,\n isFetching: false,\n currentFile: {},\n };\n case FETCH_DATAFILE_SUCCESS:\n return {\n ...state,\n currentFile: action.file,\n isFetching: false,\n };\n case FETCH_DATAFILE_FAILURE:\n return {\n ...state,\n currentFile: {},\n isFetching: false,\n };\n case PUT_DATAFILE_SUCCESS:\n return {\n ...state,\n currentFile: action.file,\n updated: true,\n datafileChanged: false,\n };\n case PUT_DATAFILE_FAILURE:\n return {\n ...state,\n datafileChanged: false,\n };\n case DELETE_DATAFILE_SUCCESS:\n return {\n ...state,\n files: filterDeleted(state.files, action.id),\n };\n case DATAFILE_CHANGED:\n return {\n ...state,\n datafileChanged: true,\n updated: false,\n };\n default:\n return {\n ...state,\n updated: false,\n datafileChanged: false,\n };\n }\n}\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport DocumentTitle from 'react-document-title';\nimport Explorer from '../../components/Explorer';\nimport { search, filterBySearchInput } from '../../ducks/utils';\nimport { fetchDataFiles, deleteDataFile } from '../../ducks/datafiles';\nimport { getDocumentTitle } from '../../utils/helpers';\n\nexport class DataFiles extends Component {\n componentDidMount() {\n const { fetchDataFiles, params } = this.props;\n fetchDataFiles(params.splat);\n }\n\n componentWillReceiveProps(nextProps) {\n const { fetchDataFiles } = nextProps;\n if (this.props.params.splat !== nextProps.params.splat) {\n fetchDataFiles(nextProps.params.splat);\n }\n }\n\n render() {\n const { isFetching, files, search, params, deleteDataFile } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n const title = getDocumentTitle('data files', params.splat);\n\n return (\n <DocumentTitle title={title}>\n <Explorer\n type=\"datafiles\"\n items={files}\n params={params}\n newBtnLabel=\"New data file\"\n search={search}\n deleteItem={deleteDataFile}\n />\n </DocumentTitle>\n );\n }\n}\n\nDataFiles.propTypes = {\n files: PropTypes.array.isRequired,\n fetchDataFiles: PropTypes.func.isRequired,\n deleteDataFile: PropTypes.func.isRequired,\n isFetching: PropTypes.bool.isRequired,\n search: PropTypes.func.isRequired,\n params: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n files: filterBySearchInput(state.datafiles.files, state.utils.input),\n isFetching: state.datafiles.isFetching,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchDataFiles,\n deleteDataFile,\n search,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(DataFiles);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport _ from 'underscore';\nimport { HotKeys } from 'react-hotkeys';\nimport DocumentTitle from 'react-document-title';\nimport DataGUI from '../../components/DataGUI';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport InputPath from '../../components/form/InputPath';\nimport Splitter from '../../components/Splitter';\nimport Errors from '../../components/Errors';\nimport Editor from '../../components/Editor';\nimport Button from '../../components/Button';\nimport { clearErrors } from '../../ducks/utils';\nimport {\n getFilenameFromPath,\n getExtensionFromPath,\n preventDefault,\n getDocumentTitle,\n} from '../../utils/helpers';\nimport {\n fetchDataFile,\n putDataFile,\n deleteDataFile,\n onDataFileChanged,\n} from '../../ducks/datafiles';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getLeaveMessage, getDeleteMessage, getNotFoundMessage } = translations;\n\nexport class DataFileEdit extends Component {\n state = {\n guiView: false,\n };\n\n componentDidMount() {\n const { fetchDataFile, params, router, route } = this.props;\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n router.setRouteLeaveHook(route, this.routerWillLeave);\n fetchDataFile(directory, filename);\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n const new_path = nextProps.datafile.path;\n const path = this.props.datafile.path;\n\n // redirect if the path is changed\n if (new_path !== path) {\n browserHistory.push(\n `${ADMIN_PREFIX}/datafiles/${nextProps.datafile.relative_path}`\n );\n }\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n const { datafileChanged, fieldChanged } = this.props;\n if (datafileChanged || fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n toggleView = () => {\n this.setState(state => {\n return { guiView: !state.guiView };\n });\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const {\n datafile,\n datafileChanged,\n fieldChanged,\n putDataFile,\n params,\n } = this.props;\n const { path, relative_path } = datafile;\n const data_dir = path.replace(relative_path, '');\n\n let name, data, mode;\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n if (datafileChanged || fieldChanged) {\n if (this.state.guiView) {\n const { filepath, extname } = this.refs.gui.refs;\n name = filepath.value + extname.value;\n data = null;\n mode = 'gui';\n } else {\n const { input } = this.refs.inputpath.refs;\n name = input.value || input.props.defaultValue;\n data = this.refs.editor.getValue();\n mode = 'editor';\n }\n\n const data_path = directory\n ? data_dir + `${directory}/` + name\n : data_dir + name;\n\n const new_path = data_path !== path ? data_path : '';\n putDataFile(directory, filename, data, new_path, mode);\n }\n };\n\n handleClickDelete(path) {\n const { deleteDataFile, params } = this.props;\n const confirm = window.confirm(getDeleteMessage(path));\n\n if (confirm) {\n const directory = params.splat[0];\n const filename = getFilenameFromPath(path);\n deleteDataFile(directory, filename);\n const dir = directory ? `/${directory}` : '';\n browserHistory.push(`${ADMIN_PREFIX}/datafiles${dir}`);\n }\n }\n\n renderAside() {\n const { datafile, datafileChanged, fieldChanged, updated } = this.props;\n const { path } = datafile;\n const filename = getFilenameFromPath(path);\n const ext = getExtensionFromPath(path);\n const guiSupport = /ya?ml|json/i.test(ext);\n\n return (\n <div className=\"content-side\">\n <Button\n onClick={this.handleClickSave}\n type=\"save\"\n active={datafileChanged || fieldChanged}\n triggered={updated}\n block\n />\n {guiSupport && (\n <Button\n onClick={this.toggleView}\n type=\"view-toggle\"\n triggered={this.state.guiView}\n active\n block\n />\n )}\n <Splitter />\n <Button\n onClick={() => this.handleClickDelete(filename)}\n type=\"delete\"\n active\n block\n />\n </div>\n );\n }\n\n renderContentBody(filename) {\n const { datafile, datafileChanged, onDataFileChanged } = this.props;\n const { raw_content, content, slug, ext } = datafile;\n const { guiView } = this.state;\n\n if (guiView && content) {\n return (\n <div className=\"content-body\">\n <DataGUI\n fields={content}\n slug={slug}\n ext={ext}\n onChange={onDataFileChanged}\n ref=\"gui\"\n />\n </div>\n );\n } else if (!guiView && raw_content) {\n return (\n <div className=\"content-body\">\n <InputPath\n onChange={onDataFileChanged}\n type=\"data files\"\n path={filename}\n ref=\"inputpath\"\n />\n <Editor\n editorChanged={datafileChanged}\n onEditorChange={onDataFileChanged}\n content={raw_content}\n type={ext}\n ref=\"editor\"\n />\n </div>\n );\n }\n }\n\n render() {\n const { datafile, isFetching, params, errors } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n if (_.isEmpty(datafile.content)) {\n return <h1>{getNotFoundMessage('content')}</h1>;\n }\n\n const directory = params.splat[0];\n const filename = getFilenameFromPath(datafile.path);\n\n const keyboardHandlers = {\n save: this.handleClickSave,\n };\n\n const document_title = getDocumentTitle('data files', directory, filename);\n\n return (\n <DocumentTitle title={document_title}>\n <HotKeys handlers={keyboardHandlers} className=\"single\">\n {errors.length > 0 && <Errors errors={errors} />}\n\n <div className=\"content-header\">\n <Breadcrumbs type=\"datafiles\" splat={directory} />\n </div>\n\n <div className=\"content-wrapper\">\n {this.renderContentBody(filename)}\n {this.renderAside()}\n </div>\n </HotKeys>\n </DocumentTitle>\n );\n }\n}\n\nDataFileEdit.propTypes = {\n fetchDataFile: PropTypes.func.isRequired,\n putDataFile: PropTypes.func.isRequired,\n deleteDataFile: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n datafile: PropTypes.object.isRequired,\n onDataFileChanged: PropTypes.func.isRequired,\n isFetching: PropTypes.bool.isRequired,\n updated: PropTypes.bool.isRequired,\n datafileChanged: PropTypes.bool.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n errors: PropTypes.array.isRequired,\n params: PropTypes.object.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n datafile: state.datafiles.currentFile,\n isFetching: state.datafiles.isFetching,\n updated: state.datafiles.updated,\n datafileChanged: state.datafiles.datafileChanged,\n fieldChanged: state.metadata.fieldChanged,\n errors: state.utils.errors,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchDataFile,\n putDataFile,\n deleteDataFile,\n onDataFileChanged,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(DataFileEdit)\n);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport { HotKeys } from 'react-hotkeys';\nimport DocumentTitle from 'react-document-title';\nimport DataGUI from '../../components/DataGUI';\nimport Errors from '../../components/Errors';\nimport Editor from '../../components/Editor';\nimport Button from '../../components/Button';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport InputPath from '../../components/form/InputPath';\nimport { clearErrors } from '../../ducks/utils';\nimport { putDataFile, onDataFileChanged } from '../../ducks/datafiles';\nimport { preventDefault, getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getLeaveMessage } = translations;\n\nexport class DataFileNew extends Component {\n state = {\n guiView: false,\n };\n\n componentDidMount() {\n const { router, route } = this.props;\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n browserHistory.push(\n `${ADMIN_PREFIX}/datafiles/${nextProps.datafile.relative_path}`\n );\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n if (!this.state.guiView && this.props.datafileChanged) {\n return getLeaveMessage();\n }\n };\n\n toggleView = () => {\n this.setState(state => {\n return { guiView: !state.guiView };\n });\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { datafileChanged, fieldChanged, putDataFile, params } = this.props;\n let filename;\n\n if (datafileChanged || fieldChanged) {\n if (this.state.guiView) {\n const { filepath, extname } = this.refs.gui.refs;\n filename = filepath.value + extname.value;\n putDataFile(params.splat, filename, null, null, 'gui');\n } else {\n filename = this.refs.inputpath.refs.input.value;\n putDataFile(params.splat, filename, this.refs.editor.getValue());\n }\n }\n };\n\n renderAside() {\n const { datafileChanged, fieldChanged, updated } = this.props;\n\n return (\n <div className=\"content-side\">\n <Button\n onClick={this.handleClickSave}\n type=\"create\"\n active={datafileChanged || fieldChanged}\n triggered={updated}\n block\n />\n <Button\n onClick={this.toggleView}\n type=\"view-toggle\"\n triggered={this.state.guiView}\n active\n block\n />\n </div>\n );\n }\n\n renderContentBody() {\n const { datafileChanged, onDataFileChanged } = this.props;\n\n if (this.state.guiView) {\n return (\n <div className=\"content-body\">\n <DataGUI onChange={onDataFileChanged} ref=\"gui\" />\n </div>\n );\n }\n\n return (\n <div className=\"content-body\">\n <InputPath\n onChange={onDataFileChanged}\n type=\"data files\"\n path=\"\"\n ref=\"inputpath\"\n />\n <Editor\n editorChanged={datafileChanged}\n onEditorChange={onDataFileChanged}\n content=\"\"\n ref=\"editor\"\n />\n </div>\n );\n }\n\n render() {\n const { errors, params } = this.props;\n\n const keyboardHandlers = {\n save: this.handleClickSave,\n };\n\n const title = getDocumentTitle('data files', params.splat, 'New data file');\n\n return (\n <DocumentTitle title={title}>\n <HotKeys handlers={keyboardHandlers}>\n {errors.length > 0 && <Errors errors={errors} />}\n\n <div className=\"content-header\">\n <Breadcrumbs type=\"datafiles\" splat={params.splat} />\n </div>\n\n <div className=\"content-wrapper\">\n {this.renderContentBody()}\n {this.renderAside()}\n </div>\n </HotKeys>\n </DocumentTitle>\n );\n }\n}\n\nDataFileNew.propTypes = {\n putDataFile: PropTypes.func.isRequired,\n datafile: PropTypes.object.isRequired,\n onDataFileChanged: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n errors: PropTypes.array.isRequired,\n updated: PropTypes.bool.isRequired,\n datafileChanged: PropTypes.bool.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n params: PropTypes.object.isRequired,\n fieldChanged: PropTypes.bool,\n};\n\nconst mapStateToProps = state => ({\n datafile: state.datafiles.currentFile,\n updated: state.datafiles.updated,\n datafileChanged: state.datafiles.datafileChanged,\n fieldChanged: state.metadata.fieldChanged,\n errors: state.utils.errors,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n putDataFile,\n onDataFileChanged,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(DataFileNew)\n);\n","import { clearErrors, validationError, filterDeleted } from './utils';\nimport { PUT_DOCUMENT_SUCCESS, PUT_DOCUMENT_FAILURE } from './collections';\nimport { get, put, del } from '../utils/fetch';\nimport { validatePage } from '../utils/validation';\nimport {\n slugify,\n preparePayload,\n sanitizeFrontMatter,\n computeRelativePath,\n} from '../utils/helpers';\nimport { draftsAPIUrl, draftAPIUrl, documentAPIUrl } from '../constants/api';\n\n// Action Types\nexport const FETCH_DRAFTS_REQUEST = 'FETCH_DRAFTS_REQUEST';\nexport const FETCH_DRAFTS_SUCCESS = 'FETCH_DRAFTS_SUCCESS';\nexport const FETCH_DRAFTS_FAILURE = 'FETCH_DRAFTS_FAILURE';\nexport const FETCH_DRAFT_REQUEST = 'FETCH_DRAFT_REQUEST';\nexport const FETCH_DRAFT_SUCCESS = 'FETCH_DRAFT_SUCCESS';\nexport const FETCH_DRAFT_FAILURE = 'FETCH_DRAFT_FAILURE';\nexport const PUT_DRAFT_REQUEST = 'PUT_DRAFT_REQUEST';\nexport const PUT_DRAFT_SUCCESS = 'PUT_DRAFT_SUCCESS';\nexport const PUT_DRAFT_FAILURE = 'PUT_DRAFT_FAILURE';\nexport const DELETE_DRAFT_REQUEST = 'DELETE_DRAFT_REQUEST';\nexport const DELETE_DRAFT_SUCCESS = 'DELETE_DRAFT_SUCCESS';\nexport const DELETE_DRAFT_FAILURE = 'DELETE_DRAFT_FAILURE';\n\n// Actions\nexport const fetchDrafts = (directory = '') => dispatch => {\n dispatch({ type: FETCH_DRAFTS_REQUEST });\n return get(\n draftsAPIUrl(directory),\n { type: FETCH_DRAFTS_SUCCESS, name: 'drafts' },\n { type: FETCH_DRAFTS_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const fetchDraft = (directory, filename) => dispatch => {\n dispatch({ type: FETCH_DRAFT_REQUEST });\n return get(\n draftAPIUrl(directory, filename),\n { type: FETCH_DRAFT_SUCCESS, name: 'draft' },\n { type: FETCH_DRAFT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const createDraft = directory => (dispatch, getState) => {\n // get edited fields from metadata state\n const metadata = getState().metadata.metadata;\n let { path, raw_content, title } = metadata;\n // if `path` is a falsy value or if appending a slash to it equals to\n // `directory`, generate filename from `title`.\n if ((!path || `${path}/` === directory) && title) {\n path = `${slugify(title)}.md`;\n } else {\n const errors = validatePage(metadata);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n }\n // clear errors\n dispatch(clearErrors());\n\n const front_matter = sanitizeFrontMatter(metadata);\n\n // strip '_drafts/' from path when provided\n const filename = path.replace('_drafts/', '');\n\n // send the put request\n return put(\n draftAPIUrl(directory, filename),\n preparePayload({ front_matter, raw_content }),\n { type: PUT_DRAFT_SUCCESS, name: 'draft' },\n { type: PUT_DRAFT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const putDraft = (directory, filename) => (dispatch, getState) => {\n // get edited fields from metadata state\n const metadata = getState().metadata.metadata;\n let { path, raw_content, title } = metadata;\n // if `path` is a falsy value or if appending a slash to it equals to\n // `directory`, generate filename from `title`.\n if ((!path || `${path}/` === directory) && title) {\n path = `${slugify(title)}.md`;\n } else {\n const errors = validatePage(metadata);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n }\n // clear errors\n dispatch(clearErrors());\n\n const front_matter = sanitizeFrontMatter(metadata);\n const relative_path = directory\n ? `_drafts/${directory}/${path}`\n : `_drafts/${path}`;\n\n // send the put request\n return put(\n draftAPIUrl(directory, filename),\n preparePayload({ path: relative_path, front_matter, raw_content }),\n { type: PUT_DRAFT_SUCCESS, name: 'draft' },\n { type: PUT_DRAFT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const deleteDraft = (directory, filename) => dispatch => {\n const relative_path = computeRelativePath(directory, filename);\n return del(\n draftAPIUrl(directory, filename),\n { type: DELETE_DRAFT_SUCCESS, name: 'draft', id: relative_path },\n { type: DELETE_DRAFT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\nexport const publishDraft = (directory, filename) => (dispatch, getState) => {\n const metadata = getState().metadata.metadata;\n let { path, raw_content, title } = metadata;\n // if path is not given or equals to directory, generate filename from the title\n if (!path && title) {\n path = `${slugify(title)}.md`;\n } else {\n const errors = validatePage(metadata);\n if (errors.length) {\n return dispatch(validationError(errors));\n }\n }\n // clear errors\n dispatch(clearErrors());\n\n const front_matter = sanitizeFrontMatter(metadata);\n\n return put(\n documentAPIUrl('posts', directory, filename),\n preparePayload({ raw_content, front_matter }),\n { type: PUT_DOCUMENT_SUCCESS, name: 'doc' },\n { type: PUT_DOCUMENT_FAILURE, name: 'error' },\n dispatch\n );\n};\n\n// Reducer\nexport default function drafts(\n state = {\n drafts: [],\n draft: {},\n isFetching: false,\n updated: false,\n },\n action\n) {\n switch (action.type) {\n case FETCH_DRAFTS_REQUEST:\n case FETCH_DRAFT_REQUEST:\n return {\n ...state,\n isFetching: true,\n };\n case FETCH_DRAFTS_SUCCESS:\n return {\n ...state,\n drafts: action.drafts,\n isFetching: false,\n draft: {},\n };\n case FETCH_DRAFTS_FAILURE:\n return {\n ...state,\n isFetching: false,\n drafts: [],\n };\n case FETCH_DRAFT_SUCCESS:\n return {\n ...state,\n draft: action.draft,\n isFetching: false,\n };\n case FETCH_DRAFT_FAILURE:\n return {\n ...state,\n draft: {},\n isFetching: false,\n };\n case PUT_DRAFT_SUCCESS:\n return {\n ...state,\n draft: action.draft,\n updated: true,\n };\n case DELETE_DRAFT_SUCCESS:\n return {\n ...state,\n drafts: filterDeleted(state.drafts, action.id),\n };\n default:\n return {\n ...state,\n updated: false,\n };\n }\n}\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport DocumentTitle from 'react-document-title';\nimport Explorer from '../../components/Explorer';\nimport { search, filterBySearchInput } from '../../ducks/utils';\nimport { fetchDrafts, deleteDraft } from '../../ducks/drafts';\nimport { getDocumentTitle } from '../../utils/helpers';\n\nexport class Drafts extends Component {\n componentDidMount() {\n const { fetchDrafts, params } = this.props;\n fetchDrafts(params.splat);\n }\n\n componentWillReceiveProps(nextProps) {\n const { fetchDrafts } = nextProps;\n if (this.props.params.splat !== nextProps.params.splat) {\n fetchDrafts(nextProps.params.splat);\n }\n }\n\n render() {\n const { isFetching, drafts, search, params, deleteDraft } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n const title = getDocumentTitle('drafts', params.splat);\n\n return (\n <DocumentTitle title={title}>\n <Explorer\n type=\"drafts\"\n items={drafts}\n params={params}\n newBtnLabel=\"New draft\"\n search={search}\n deleteItem={deleteDraft}\n />\n </DocumentTitle>\n );\n }\n}\n\nDrafts.propTypes = {\n drafts: PropTypes.array.isRequired,\n fetchDrafts: PropTypes.func.isRequired,\n deleteDraft: PropTypes.func.isRequired,\n isFetching: PropTypes.bool.isRequired,\n search: PropTypes.func.isRequired,\n params: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n drafts: filterBySearchInput(state.drafts.drafts, state.utils.input),\n isFetching: state.drafts.isFetching,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchDrafts,\n deleteDraft,\n search,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(Drafts);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport { HotKeys } from 'react-hotkeys';\nimport _ from 'underscore';\nimport moment from 'moment';\nimport DocumentTitle from 'react-document-title';\nimport Button from '../../components/Button';\nimport Errors from '../../components/Errors';\nimport Splitter from '../../components/Splitter';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport MarkdownPageBody from '../../components/MarkdownPageBody';\nimport {\n fetchDraft,\n deleteDraft,\n putDraft,\n publishDraft,\n} from '../../ducks/drafts';\nimport { updateTitle, updateBody, updatePath } from '../../ducks/metadata';\nimport { clearErrors } from '../../ducks/utils';\nimport { preventDefault, getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst {\n getLeaveMessage,\n getDeleteMessage,\n getPublishDraftMessage,\n} = translations;\n\nexport class DraftEdit extends Component {\n componentDidMount() {\n const { fetchDraft, params, router, route } = this.props;\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n fetchDraft(directory, filename);\n\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n const new_path = nextProps.draft.path;\n const path = this.props.draft.path;\n // redirect if the path is changed\n if (new_path !== path) {\n browserHistory.push(\n `${ADMIN_PREFIX}/drafts/${nextProps.draft.relative_path}`\n );\n }\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n if (this.props.fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { putDraft, fieldChanged, params } = this.props;\n if (fieldChanged) {\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n putDraft(directory, filename);\n }\n };\n\n handleClickPublish(path) {\n const { deleteDraft, publishDraft, params } = this.props;\n\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n const today = moment().format('YYYY-MM-DD');\n const datedfilename = `${today}-${filename}`;\n const postPath = directory\n ? `_posts/${directory}/${datedfilename}`\n : `_posts/${datedfilename}`;\n\n const confirm = window.confirm(getPublishDraftMessage(path, postPath));\n if (confirm) {\n const goTo = directory ? `/${directory}` : '';\n deleteDraft(directory, filename);\n publishDraft(directory, datedfilename);\n browserHistory.push(`${ADMIN_PREFIX}/drafts${goTo}`);\n }\n }\n\n handleClickDelete(name) {\n const { deleteDraft, params } = this.props;\n const confirm = window.confirm(getDeleteMessage(name));\n if (confirm) {\n const [directory, ...rest] = params.splat;\n const filename = rest.join('.');\n const goTo = directory ? `/${directory}` : '';\n deleteDraft(directory, filename);\n browserHistory.push(`${ADMIN_PREFIX}/drafts${goTo}`);\n }\n }\n\n render() {\n const {\n isFetching,\n draft,\n errors,\n updateTitle,\n updateBody,\n updatePath,\n updated,\n fieldChanged,\n params,\n } = this.props;\n\n if (isFetching) {\n return null;\n } else if (_.isEmpty(draft)) {\n return <h1>Could not find the draft.</h1>;\n }\n\n const keyboardHandlers = {\n save: this.handleClickSave,\n };\n\n const {\n name,\n path,\n raw_content,\n http_url,\n front_matter,\n front_matter_defaults,\n } = draft;\n const directory = params.splat[0];\n const title = front_matter && front_matter.title ? front_matter.title : '';\n const document_title = getDocumentTitle('drafts', directory, title || name);\n\n return (\n <DocumentTitle title={document_title}>\n <HotKeys handlers={keyboardHandlers} className=\"single\">\n {errors.length > 0 && <Errors errors={errors} />}\n <div className=\"content-header\">\n <Breadcrumbs type=\"drafts\" splat={directory} />\n </div>\n\n <div className=\"content-wrapper\">\n <MarkdownPageBody\n type=\"drafts\"\n path={name}\n title={title}\n body={raw_content}\n updatePath={updatePath}\n updateBody={updateBody}\n updateTitle={updateTitle}\n onSave={this.handleClickSave}\n metafields={{ title, raw_content, path: name, ...front_matter }}\n staticmetafields={front_matter_defaults}\n />\n <div className=\"content-side\">\n <Button\n onClick={this.handleClickSave}\n type=\"save\"\n active={fieldChanged}\n triggered={updated}\n block\n />\n <Button to={http_url} type=\"view\" active block />\n <Splitter />\n <Button\n onClick={() => this.handleClickPublish(path)}\n type=\"publish\"\n active\n block\n />\n <Button\n onClick={() => this.handleClickDelete(name)}\n type=\"delete\"\n active\n block\n />\n </div>\n </div>\n </HotKeys>\n </DocumentTitle>\n );\n }\n}\n\nDraftEdit.propTypes = {\n draft: PropTypes.object.isRequired,\n fetchDraft: PropTypes.func.isRequired,\n deleteDraft: PropTypes.func.isRequired,\n putDraft: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n publishDraft: PropTypes.func.isRequired,\n isFetching: PropTypes.bool.isRequired,\n errors: PropTypes.array.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n updated: PropTypes.bool.isRequired,\n params: PropTypes.object.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n draft: state.drafts.draft,\n isFetching: state.drafts.isFetching,\n fieldChanged: state.metadata.fieldChanged,\n updated: state.drafts.updated,\n errors: state.utils.errors,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchDraft,\n deleteDraft,\n putDraft,\n publishDraft,\n updateTitle,\n updateBody,\n updatePath,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(DraftEdit)\n);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport { browserHistory, withRouter } from 'react-router';\nimport DocumentTitle from 'react-document-title';\nimport CreateMarkdownPage from '../../components/CreateMarkdownPage';\nimport { updateTitle, updateBody, updatePath } from '../../ducks/metadata';\nimport { createDraft } from '../../ducks/drafts';\nimport { clearErrors } from '../../ducks/utils';\nimport { preventDefault, getDocumentTitle } from '../../utils/helpers';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getLeaveMessage } = translations;\n\nexport class DraftNew extends Component {\n componentDidMount() {\n const { router, route } = this.props;\n router.setRouteLeaveHook(route, this.routerWillLeave);\n }\n\n componentWillReceiveProps(nextProps) {\n if (this.props.updated !== nextProps.updated) {\n browserHistory.push(\n `${ADMIN_PREFIX}/drafts/${nextProps.draft.relative_path}`\n );\n }\n }\n\n componentWillUnmount() {\n const { clearErrors, errors } = this.props;\n errors.length && clearErrors();\n }\n\n routerWillLeave = nextLocation => {\n if (this.props.fieldChanged) {\n return getLeaveMessage();\n }\n };\n\n handleClickSave = e => {\n preventDefault(e);\n const { fieldChanged, createDraft, params } = this.props;\n fieldChanged && createDraft(params.splat);\n };\n\n render() {\n const {\n params,\n config,\n errors,\n updated,\n updateBody,\n updatePath,\n updateTitle,\n fieldChanged,\n } = this.props;\n\n const title = getDocumentTitle('drafts', params.splat, 'New draft');\n\n return (\n <DocumentTitle title={title}>\n <CreateMarkdownPage\n type=\"drafts\"\n params={params}\n config={config}\n errors={errors}\n updated={updated}\n updateBody={updateBody}\n updatePath={updatePath}\n updateTitle={updateTitle}\n fieldChanged={fieldChanged}\n onClickSave={this.handleClickSave}\n />\n </DocumentTitle>\n );\n }\n}\n\nDraftNew.propTypes = {\n createDraft: PropTypes.func.isRequired,\n updateTitle: PropTypes.func.isRequired,\n updateBody: PropTypes.func.isRequired,\n updatePath: PropTypes.func.isRequired,\n clearErrors: PropTypes.func.isRequired,\n errors: PropTypes.array.isRequired,\n fieldChanged: PropTypes.bool.isRequired,\n updated: PropTypes.bool.isRequired,\n router: PropTypes.object.isRequired,\n route: PropTypes.object.isRequired,\n params: PropTypes.object.isRequired,\n config: PropTypes.object.isRequired,\n draft: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n draft: state.drafts.draft,\n fieldChanged: state.metadata.fieldChanged,\n errors: state.utils.errors,\n updated: state.drafts.updated,\n config: state.config.config,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n updateTitle,\n updateBody,\n updatePath,\n createDraft,\n clearErrors,\n },\n dispatch\n );\n\nexport default withRouter(\n connect(mapStateToProps, mapDispatchToProps)(DraftNew)\n);\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport _ from 'underscore';\nimport ReactDropzone from 'react-dropzone';\nimport FilePreview from './FilePreview';\nimport Splitter from './Splitter';\nimport Icon from './Icon';\n\nexport class Dropzone extends Component {\n openDropzone() {\n this.refs.ReactDropzone.open();\n }\n\n render() {\n const { files, splat, onDrop, onClickDelete, onClickItem } = this.props;\n return (\n <ReactDropzone\n onDrop={onDrop}\n ref=\"ReactDropzone\"\n className=\"dropzone\"\n activeClassName=\"dropzone-active\"\n multiple\n disableClick\n >\n {files.length ? (\n <div className=\"preview-container\">\n {_.map(files, (file, i) => (\n <FilePreview\n key={i}\n onClick={onClickItem}\n onClickDelete={onClickDelete}\n splat={splat}\n file={file}\n />\n ))}\n <Splitter />\n <div className=\"preview-tip\">\n <div>Drag and drop file(s) here to upload</div>\n </div>\n </div>\n ) : (\n <div className=\"preview-info\">\n <Icon name=\"upload\" />\n <p>Drag and drop file(s) here to upload</p>\n </div>\n )}\n </ReactDropzone>\n );\n }\n}\n\nDropzone.propTypes = {\n files: PropTypes.array.isRequired,\n splat: PropTypes.string.isRequired,\n onDrop: PropTypes.func.isRequired,\n onClickDelete: PropTypes.func.isRequired,\n onClickItem: PropTypes.func,\n};\n\nexport default Dropzone;\n","import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\nimport { Link } from 'react-router';\nimport { connect } from 'react-redux';\nimport { bindActionCreators } from 'redux';\nimport DocumentTitle from 'react-document-title';\nimport Dropzone from '../../components/Dropzone';\nimport Button from '../../components/Button';\nimport Icon from '../../components/Icon';\nimport Breadcrumbs from '../../components/Breadcrumbs';\nimport InputSearch from '../../components/form/InputSearch';\nimport { search } from '../../ducks/utils';\nimport {\n existingUploadedFilenames,\n getDocumentTitle,\n} from '../../utils/helpers';\nimport {\n fetchStaticFiles,\n uploadStaticFiles,\n deleteStaticFile,\n filterByFilename,\n} from '../../ducks/staticfiles';\nimport { ADMIN_PREFIX } from '../../constants';\n\nimport translations from '../../translations';\nconst { getOverrideMessage } = translations;\n\nexport class StaticFiles extends Component {\n componentDidMount() {\n const { fetchStaticFiles, params } = this.props;\n fetchStaticFiles(params.splat);\n }\n\n componentWillReceiveProps(nextProps) {\n const { fetchStaticFiles } = nextProps;\n if (this.props.params.splat !== nextProps.params.splat) {\n fetchStaticFiles(nextProps.params.splat);\n }\n }\n\n onDrop(uploadedFiles) {\n const { uploadStaticFiles, files, params } = this.props;\n const existingFiles = existingUploadedFilenames(uploadedFiles, files);\n if (existingFiles.length > 0) {\n const confirm = window.confirm(\n getOverrideMessage(existingFiles.join(', '))\n );\n if (!confirm) {\n return false;\n }\n }\n uploadStaticFiles(params.splat, uploadedFiles);\n }\n\n openDropzone = () => {\n this.refs.dropzone.openDropzone();\n };\n\n renderFilePreviewRow(static_files, key) {\n const { params, onClickStaticFile, deleteStaticFile } = this.props;\n return (\n <tr key={key}>\n <td>\n <Dropzone\n ref=\"dropzone\"\n splat={params.splat || ''}\n files={static_files}\n onClickItem={onClickStaticFile}\n onClickDelete={deleteStaticFile}\n onDrop={static_files => this.onDrop(static_files)}\n />\n </td>\n </tr>\n );\n }\n\n renderDirectoryRow(directory, index) {\n const { name, path } = directory;\n const to = `${ADMIN_PREFIX}/staticfiles/${path}`;\n return (\n <tr key={index}>\n <td className=\"row-title\">\n <strong>\n <Link to={to}>\n <Icon name=\"folder\" />\n {name}\n </Link>\n </strong>\n </td>\n </tr>\n );\n }\n\n renderRows() {\n const { files } = this.props;\n const dirs = files.filter(entity => entity.type === 'directory');\n const static_files = files.filter(entity => !entity.type);\n\n return dirs\n .map((entry, index) => this.renderDirectoryRow(entry, index))\n .concat(this.renderFilePreviewRow(static_files, dirs.length + 1));\n }\n\n renderTable() {\n return (\n <div className=\"content-table\">\n <table>\n <thead>\n <tr>\n <th>Directory Contents</th>\n </tr>\n </thead>\n <tbody>{this.renderRows()}</tbody>\n </table>\n </div>\n );\n }\n\n render() {\n const { isFetching, params, search } = this.props;\n\n if (isFetching) {\n return null;\n }\n\n const to = `${ADMIN_PREFIX}/staticfiles/index`;\n const title = getDocumentTitle('static files', params.splat);\n\n return (\n <DocumentTitle title={title}>\n <div>\n <div className=\"content-header\">\n <Breadcrumbs type=\"staticfiles\" splat={params.splat} />\n <div className=\"page-buttons multiple\">\n <Link className=\"btn btn-view\" to={to}>\n Index Listing\n </Link>\n <Button\n onClick={() => this.openDropzone()}\n type=\"upload\"\n active\n />\n </div>\n <div className=\"pull-right\">\n <InputSearch searchBy=\"filename\" search={search} />\n </div>\n </div>\n {this.renderTable()}\n </div>\n </DocumentTitle>\n );\n }\n}\n\nStaticFiles.propTypes = {\n files: PropTypes.array.isRequired,\n isFetching: PropTypes.bool.isRequired,\n fetchStaticFiles: PropTypes.func.isRequired,\n uploadStaticFiles: PropTypes.func.isRequired,\n deleteStaticFile: PropTypes.func.isRequired,\n onClickStaticFile: PropTypes.func,\n search: PropTypes.func.isRequired,\n params: PropTypes.object.isRequired,\n};\n\nconst mapStateToProps = state => ({\n files: filterByFilename(state.staticfiles.files, state.utils.input),\n isFetching: state.staticfiles.isFetching,\n});\n\nconst mapDispatchToProps = dispatch =>\n bindActionCreators(\n {\n fetchStaticFiles,\n uploadStaticFiles,\n deleteStaticFile,\n search,\n },\n dispatch\n );\n\nexport default connect(mapStateToProps, mapDispatchToProps)(StaticFiles);\n","import React from 'react';\n\nconst NotFound = () => (\n <div className=\"notfound\">\n <img src={require('../../assets/images/logo-black-red.png')} alt=\"Jekyll Admin\" />\n <h1>Huh. It seems that page is Hyde-ing...</h1>\n <h2>The resource you requested was not found.</h2>\n </div>\n);\n\nexport default NotFound;\n","import React from 'react';\nimport { Route, IndexRoute } from 'react-router';\nimport { ADMIN_PREFIX } from './constants';\n\nimport App from './containers/App';\nimport Configuration from './containers/views/Configuration';\nimport Pages from './containers/views/Pages';\nimport PageEdit from './containers/views/PageEdit';\nimport PageNew from './containers/views/PageNew';\nimport Documents from './containers/views/Documents';\nimport DocumentEdit from './containers/views/DocumentEdit';\nimport DocumentNew from './containers/views/DocumentNew';\nimport DataFiles from './containers/views/DataFiles';\nimport DataFileEdit from './containers/views/DataFileEdit';\nimport DataFileNew from './containers/views/DataFileNew';\nimport Drafts from './containers/views/Drafts';\nimport DraftEdit from './containers/views/DraftEdit';\nimport DraftNew from './containers/views/DraftNew';\nimport StaticFiles from './containers/views/StaticFiles';\nimport StaticIndex from './containers/views/StaticIndex';\nimport NotFound from './containers/views/NotFound';\n\nexport default (\n <Route path={`${ADMIN_PREFIX}`} component={App}>\n <IndexRoute component={Pages} />\n <Route path=\"configuration\" component={Configuration} />\n <Route path=\"pages\">\n <IndexRoute component={Pages} />\n <Route path=\"(**/)new\" component={PageNew} />\n <Route path=\"(**/)*.*\" component={PageEdit} />\n <Route path=\"**\" component={Pages} />\n </Route>\n <Route path=\"collections\">\n <Route path=\":collection_name\">\n <IndexRoute component={Documents} />\n <Route path=\"(**/)new\" component={DocumentNew} />\n <Route path=\"(**/)*.*\" component={DocumentEdit} />\n <Route path=\"**\" component={Documents} />\n </Route>\n </Route>\n <Route path=\"drafts\">\n <IndexRoute component={Drafts} />\n <Route path=\"(**/)new\" component={DraftNew} />\n <Route path=\"(**/)*.*\" component={DraftEdit} />\n <Route path=\"**\" component={Drafts} />\n </Route>\n <Route path=\"datafiles\">\n <IndexRoute component={DataFiles} />\n <Route path=\"(**/)new\" component={DataFileNew} />\n <Route path=\"(**/)*.*\" component={DataFileEdit} />\n <Route path=\"**\" component={DataFiles} />\n </Route>\n <Route path=\"staticfiles\">\n <IndexRoute component={StaticFiles} />\n <Route path=\"index\" component={StaticIndex} />\n <Route path=\"**\" component={StaticFiles} />\n </Route>\n <Route path={`${ADMIN_PREFIX}/*`} component={NotFound} />\n </Route>\n);\n","import { combineReducers } from 'redux';\nimport { routerReducer } from 'react-router-redux';\n\nimport config from './config';\nimport pages from './pages';\nimport collections from './collections';\nimport metadata from './metadata';\nimport drafts from './drafts';\nimport datafiles from './datafiles';\nimport staticfiles from './staticfiles';\nimport utils from './utils';\nimport siteMeta from './siteMeta';\nimport notifications from './notifications';\n\nexport default combineReducers({\n routing: routerReducer,\n meta: siteMeta,\n config,\n pages,\n collections,\n metadata,\n drafts,\n datafiles,\n staticfiles,\n utils,\n notifications,\n});\n","import { createStore, compose, applyMiddleware } from 'redux';\nimport reduxImmutableStateInvariant from 'redux-immutable-state-invariant';\nimport thunk from 'redux-thunk';\nimport createLogger from 'redux-logger';\nimport rootReducer from './ducks';\n\nconst logger = createLogger();\n\nconst configureStoreProd = initialState => {\n const middlewares = [thunk];\n\n return createStore(\n rootReducer,\n initialState,\n compose(applyMiddleware(...middlewares))\n );\n};\n\nconst configureStoreDev = initialState => {\n const middlewares = [reduxImmutableStateInvariant(), thunk, logger];\n\n const composeEnhancers =\n window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;\n const store = createStore(\n rootReducer,\n initialState,\n composeEnhancers(applyMiddleware(...middlewares))\n );\n\n if (module.hot) {\n module.hot.accept('./ducks', () => {\n const nextReducer = require('./ducks').default;\n store.replaceReducer(nextReducer);\n });\n }\n\n return store;\n};\n\nconst configureStore =\n process.env.NODE_ENV === 'production'\n ? configureStoreProd\n : configureStoreDev;\n\nexport default configureStore;\n","/* eslint-disable import/default */\nimport React from 'react';\nimport { syncHistoryWithStore } from 'react-router-redux';\nimport { render } from 'react-dom';\nimport { Provider } from 'react-redux';\nimport { Router, browserHistory, Redirect } from 'react-router';\nimport routes from './routes';\nimport configureStore from './store';\nimport { ADMIN_PREFIX } from './constants';\nimport './styles/main.scss';\n\nconst store = configureStore();\nconst history = syncHistoryWithStore(browserHistory, store);\n\nrender(\n <Provider store={store}>\n <Router history={history} routes={routes}>\n <Redirect from={`${ADMIN_PREFIX}/`} to={`${ADMIN_PREFIX}/pages/`} />\n </Router>\n </Provider>,\n document.getElementById('root')\n);\n"],"sourceRoot":""}