UNPKG

orkan

Version:

__[Orkan](https://www.orkanjs.com) is a content management toolkit for building and managing dynamic React applications with ease.__

1 lines 19.9 kB
[{"name":"Collection","type":"component","description":"A component for rendering collections. expects a path and a render function. the render function receives the collection item as an argument.","props":{"path":{"type":{"name":"string"},"required":true,"description":"the path of the data in the database."},"renderItem":{"type":{"name":"func"},"required":false,"description":"will be called when the data is available, expects it to return a renderable value. (collectionItem) => ReactNode","defaultValue":{"value":"() => null","computed":false}},"lightOverlay":{"type":{"name":"bool"},"required":false,"description":"will render the edit overlay in alternate colors to support different color schemes.","defaultValue":{"value":"false","computed":false}},"orderBy":{"type":{"name":"objectOf","value":{"name":"enum","value":[{"value":"'asc'","computed":false},{"value":"'desc'","computed":false}]}},"required":false,"description":"define Firestore's ordering rules"},"where":{"type":{"name":"objectOf","value":{"name":"shape","value":{"==":{"name":"union","value":[{"name":"string"},{"name":"number"}],"required":false},"!=":{"name":"union","value":[{"name":"string"},{"name":"number"}],"required":false},">=":{"name":"union","value":[{"name":"string"},{"name":"number"}],"required":false},"<=":{"name":"union","value":[{"name":"string"},{"name":"number"}],"required":false}}}},"required":false,"description":"define Firestore's filtering rules"},"limit":{"type":{"name":"number"},"required":false,"description":"define Firestore's limit"}},"file":"src/components/collection/index.js"},{"name":"Value","type":"component","description":"A component for rendering simple values by their path.","props":{"path":{"type":{"name":"string"},"required":true,"description":"the path of the data in the database."},"html":{"type":{"name":"bool"},"required":false,"description":"if set to true, will render the value as html, perfect for WYSIWYG purposes."},"lightOverlay":{"type":{"name":"bool"},"required":false,"description":"will render the edit overlay in alternate colors to support different color schemes.","defaultValue":{"value":"false","computed":false}}},"file":"src/components/value/index.js"},{"name":"WithValue","type":"component","description":"A components for rendering any value, expects a path and a render function. the render function receives the value as an argument.","props":{"path":{"type":{"name":"string"},"required":true,"description":"the path of the data in the database."},"lightOverlay":{"type":{"name":"bool"},"required":false,"description":"will render the edit overlay in alternate colors to support different color schemes.","defaultValue":{"value":"false","computed":false}},"render":{"type":{"name":"func"},"required":false,"description":"will be called when the data is available, expects it to return a renderable value. (value) => ReactNode"}},"file":"src/components/with-value/index.js"},{"name":"Provider","type":"component","description":"The root of every Orkan app, provides a react contextual api to every other orkan component in the tree.","props":{"adminConfig":{"type":{"name":"shape","value":{"color":{"name":"enum","value":[{"value":"'default'","computed":false},{"value":"'dark'","computed":false}],"required":false},"authProviders":{"name":"arrayOf","value":{"name":"enum","computed":true,"value":"SUPPORTED_AUTH_PROVIDERS"},"required":false},"allowGuests":{"name":"bool","required":false}}},"required":false,"description":"a configuration object for the admin interface, leaving it undefined will disable the admin entirely.\nsupported auth providers: 'google', 'facebook', 'github'."},"firebaseConfig":{"type":{"name":"shape","value":{"apiKey":{"name":"string","required":false},"authDomain":{"name":"string","required":false},"databaseURL":{"name":"string","required":false},"projectId":{"name":"string","required":false},"storageBucket":{"name":"string","required":false},"messagingSenderId":{"name":"string","required":false}}},"required":true,"description":"Firebase config object copied from the Firebase console."}},"file":"src/components/provider/index.js"},{"name":"List","type":"component","description":"A component for rendering lists. expects a path and a render function. the render function receives the collection item as an argument.","props":{"path":{"type":{"name":"string"},"required":true,"description":"the path of the data in the database."},"renderItem":{"type":{"name":"func"},"required":false,"description":"will be called when the data is available, expects it to return a renderable value. (collectionItem) => ReactNode","defaultValue":{"value":"() => null","computed":false}},"lightOverlay":{"type":{"name":"bool"},"required":false,"description":"will render the edit overlay in alternate colors to support different color schemes.","defaultValue":{"value":"false","computed":false}}},"file":"src/components/list/index.js"},{"name":"Firestore","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"A thin observable wrapper around Firestore's SDK","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":49,"offset":48},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":49,"offset":48},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":49,"offset":48}}},"type":"class","params":[{"title":"param","name":"api","lineNumber":2,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"A Firebase SDK Firestore instance","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":34,"offset":33},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":34,"offset":33},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":34,"offset":33}}},"type":{"type":"NameExpression","name":"firebae.firestore"}},{"title":"param","name":"initialState","lineNumber":3,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"the initial state of the store, perfect for server rendering hydration process","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":79,"offset":78},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":79,"offset":78},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":79,"offset":78}}},"type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"object"}},"default":"{}"},{"title":"param","name":"options","lineNumber":4,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"an options object which accepts DocumentSnapshot, QuerySnapshot and QueryDocumentSnapshot","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":90,"offset":89},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":90,"offset":89},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":90,"offset":89}}},"type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"object"}},"default":"{}"}],"file":"src/firestore.js","returns":[],"methods":[{"name":"getValue","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Synchronously returns an observable value from the local cache.","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":64,"offset":63},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":64,"offset":63},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":64,"offset":63}}},"type":"function","params":[{"title":"param","name":"path","lineNumber":2,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"the path of the data in the database","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36}}},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"options","lineNumber":3,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"an options object which accepts where, orderBy, limit","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53}}},"type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"object"}}}],"file":"src/firestore.js","returns":[{"description":{"type":"root","children":[],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":1,"offset":0}}},"title":"returns","type":{"type":"NameExpression","name":"any"}}],"methods":[]},{"name":"setValue","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Writes into a path and updates local cache.\nif the path is a collection path, a document with an auto generated id will be pushed","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":2,"column":86,"offset":129},"indent":[1]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":2,"column":86,"offset":129},"indent":[1]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":2,"column":86,"offset":129}}},"type":"function","params":[{"title":"param","name":"path","lineNumber":3,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"the path of the data in the database","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36}}},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"value","lineNumber":4,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"the new value to write","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":23,"offset":22},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":23,"offset":22},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":23,"offset":22}}},"type":{"type":"NameExpression","name":"any"}}],"file":"src/firestore.js","returns":[{"description":{"type":"root","children":[],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":1,"offset":0}}},"title":"returns","type":{"type":"NameExpression","name":"promise"}}],"methods":[]},{"name":"listen","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Register a path to listen to, updates will update th local cache automatically","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":79,"offset":78},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":79,"offset":78},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":79,"offset":78}}},"type":"function","params":[{"title":"param","name":"path","lineNumber":2,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"the path of the data in the database","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36}}},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"options","lineNumber":3,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"an options object which accepts where, orderBy, limit","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53}}},"type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"object"}}}],"file":"src/firestore.js","returns":[{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"a destroy function for the listener","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":36,"offset":35},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":36,"offset":35},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":36,"offset":35}}},"title":"returns","type":{"type":"NameExpression","name":"function"}}],"methods":[]},{"name":"load","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Loads a value once from the database and update the local cache","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":64,"offset":63},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":64,"offset":63},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":64,"offset":63}}},"type":"function","params":[{"title":"param","name":"path","lineNumber":2,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"the path of the data in the database","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36}}},"type":{"type":"NameExpression","name":"string"}},{"title":"param","name":"options","lineNumber":3,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"an options object which accepts where, orderBy, limit","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":54,"offset":53}}},"type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"object"}}}],"file":"src/firestore.js","returns":[{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"when resolved, will contain the loaded value","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":45,"offset":44},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":45,"offset":44},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":45,"offset":44}}},"title":"returns","type":{"type":"NameExpression","name":"promise"}}],"methods":[]},{"name":"remove","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"Removes a path from the database and local cache","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":49,"offset":48},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":49,"offset":48},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":49,"offset":48}}},"type":"function","params":[{"title":"param","name":"path","lineNumber":2,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"the path of the data in the database","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":37,"offset":36}}},"type":{"type":"NameExpression","name":"string"}}],"file":"src/firestore.js","returns":[{"description":{"type":"root","children":[],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":1,"offset":0}}},"title":"returns","type":{"type":"NameExpression","name":"promise"}}],"methods":[]}]},{"name":"inject","description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"A react component decorator, returns a new component with the requested data injected as props","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":95,"offset":94},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":95,"offset":94},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":95,"offset":94}}},"type":"function","params":[{"title":"param","name":"mapPropsToPaths","lineNumber":2,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"a function which receives the props as arguments and returns an object of required resources to load.\n","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":2,"column":1,"offset":102},"indent":[1]}},{"type":"inlineCode","value":"props => ({injectAs: pathStr | {path, [where], [orderBy], ..} }","position":{"start":{"line":2,"column":1,"offset":102},"end":{"line":2,"column":70,"offset":171},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":2,"column":70,"offset":171},"indent":[1]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":2,"column":70,"offset":171}}},"type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"function"}},"default":"()=>{}"},{"title":"param","name":"config","lineNumber":4,"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"a config object. supports: liveEditedData","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":42,"offset":41},"indent":[]}},{"type":"linkReference","identifier":"bool","referenceType":"shortcut","children":[{"type":"text","value":"bool","position":{"start":{"line":1,"column":43,"offset":42},"end":{"line":1,"column":47,"offset":46},"indent":[]}}],"position":{"start":{"line":1,"column":42,"offset":41},"end":{"line":1,"column":48,"offset":47},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":48,"offset":47},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":48,"offset":47}}},"type":{"type":"OptionalType","expression":{"type":"NameExpression","name":"object"}}}],"file":"src/inject.js","returns":[{"description":{"type":"root","children":[{"type":"paragraph","children":[{"type":"text","value":"a new higher order component","position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":29,"offset":28},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":29,"offset":28},"indent":[]}}],"position":{"start":{"line":1,"column":1,"offset":0},"end":{"line":1,"column":29,"offset":28}}},"title":"returns","type":{"type":"NameExpression","name":"ReactComponent"}}],"methods":[]}]