├── .npmignore ├── .babelrc ├── src ├── assets │ ├── icons │ │ ├── favicon-github.png │ │ └── maximize.svg │ └── docs │ │ └── serveIndex.css ├── wiki │ ├── css │ │ ├── const.js │ │ ├── const.less │ │ ├── util.js │ │ └── reset.less │ ├── blocks │ │ ├── pages │ │ │ ├── Page.jsx │ │ │ ├── Projects.jsx │ │ │ ├── Libs.jsx │ │ │ ├── Block.jsx │ │ │ └── Wiki.jsx │ │ ├── Menu │ │ │ ├── tick-m.svg │ │ │ └── Menu.jsx │ │ ├── WButton │ │ │ ├── i │ │ │ │ ├── right-m.svg │ │ │ │ ├── down-l.svg │ │ │ │ ├── up-l.svg │ │ │ │ ├── down-m.svg │ │ │ │ ├── up-m.svg │ │ │ │ ├── right-l.svg │ │ │ │ └── close-10.svg │ │ │ ├── WButton.jsx │ │ │ └── WButton.less │ │ ├── Cut.jsx │ │ ├── Spinner.jsx │ │ ├── TOC.jsx │ │ ├── WExample │ │ │ ├── github.css │ │ │ ├── WExample.less │ │ │ └── WExample.jsx │ │ ├── Form.jsx │ │ ├── WDoc │ │ │ ├── WDoc.jsx │ │ │ └── WDoc.less │ │ ├── forms │ │ │ ├── NewLibrary.jsx │ │ │ └── NewBlock.jsx │ │ ├── Pane.jsx │ │ ├── Link.jsx │ │ ├── Modal.jsx │ │ ├── Input.jsx │ │ ├── Markdown.jsx │ │ ├── Select.jsx │ │ └── Search.jsx │ ├── router.jsx │ ├── docs.html │ └── lib │ │ └── api-client.js ├── server │ └── api │ │ ├── snapshots.js │ │ ├── libraries.js │ │ └── blocks.js ├── index.js └── compilers │ └── markdown.js ├── AUTHORS ├── .gitignore ├── webpack.config.js ├── .eslintrc.js ├── package.json └── LICENSE /.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": ["es2015", "stage-0", "react"], 3 | "plugins": ["transform-flow-strip-types"] 4 | } 5 | -------------------------------------------------------------------------------- /src/assets/icons/favicon-github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yandex/dpt-docs/master/src/assets/icons/favicon-github.png -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | The following authors have created the source code of "Depot" published and distributed by YANDEX LLC as the owner: 2 | Shitov Artem 3 | Kovchiy Danil 4 | Shein Anton 5 | -------------------------------------------------------------------------------- /src/wiki/css/const.js: -------------------------------------------------------------------------------- 1 | export const colors = { 2 | selection: '#ffeba0', 3 | pane: '#f6f5f3' 4 | }; 5 | 6 | export const borders = { 7 | basic: '1px solid rgba(0, 0, 0, 0.1)', 8 | button: '1px solid rgba(0, 0, 0, 0.2)', 9 | light: '1px solid rgba(0, 0, 0, 0.06)' 10 | }; 11 | -------------------------------------------------------------------------------- /src/wiki/blocks/pages/Page.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, css } from 'aphrodite/no-important'; 3 | 4 | const s = StyleSheet.create({ 5 | page: { 6 | position: 'relative', 7 | height: '100%', 8 | fontFamily: '"Helvetica Neue", Arial, sans-serif', 9 | fontSize: 13 10 | } 11 | }); 12 | 13 | export default function Page(props) { 14 | return
15 | } 16 | -------------------------------------------------------------------------------- /src/wiki/router.jsx: -------------------------------------------------------------------------------- 1 | import 'babel-polyfill'; 2 | 3 | import React from 'react'; 4 | import ReactDOM from 'react-dom'; 5 | import { BrowserRouter, Route } from 'react-router-dom'; 6 | 7 | import Wiki from './blocks/pages/Wiki'; 8 | 9 | function WikiRouter(props) { 10 | return 11 | 12 | ; 13 | } 14 | 15 | document.addEventListener('DOMContentLoaded', () => 16 | ReactDOM.render(, document.querySelector('#renderTarget')) 17 | ); 18 | -------------------------------------------------------------------------------- /src/wiki/blocks/Menu/tick-m.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/wiki/blocks/WButton/i/right-m.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/wiki/docs.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 18 | 19 | Depot 20 | 21 | 22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /src/wiki/css/const.less: -------------------------------------------------------------------------------- 1 | @wiki-pane-background: #f6f5f3; 2 | @color-neowhite: #F3F1ED; //Бежевый для подложек 3 | @color-action: #fc0; //Для жёлтых кнопок 4 | @color-selection: #ffeba0; //Цвет нажатых контролов 5 | @button-height-s: 24px; // 6 | @button-height-m: 28px; // 7 | @button-height-l: 32px; // 8 | @button-radius: 3px; // 9 | @button-border-color: rgba(0, 0, 0, 0.2); //Цвет границ контролов 10 | @time-fast: 0.1s; // 11 | @serp-typo-size-sign: 13px; // 12 | @serp-grid-col-width: 30px; //Ширина колонки 13 | @serp-grid-gap-width: 16px; //Величина межколонника 14 | 15 | .shadoWControl () { 16 | box-shadow+:0 1px 0 0 rgba(0,0,0,.12), 0 5px 10px -3px rgba(0,0,0,.3); 17 | } 18 | -------------------------------------------------------------------------------- /src/wiki/blocks/WButton/i/down-l.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/wiki/blocks/WButton/i/up-l.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # Compiled binary addons (http://nodejs.org/api/addons.html) 20 | build/Release 21 | 22 | # Dependency directory 23 | # Deployed apps should consider commenting this line out: 24 | # see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git 25 | node_modules 26 | 27 | build 28 | /.vscode 29 | 30 | .DS_Store 31 | -------------------------------------------------------------------------------- /src/wiki/blocks/WButton/i/down-m.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/wiki/blocks/WButton/i/up-m.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/wiki/css/util.js: -------------------------------------------------------------------------------- 1 | export function hex2rgb(hex) { 2 | let color; 3 | 4 | if (typeof hex === 'string') { 5 | if (hex[0] === '#') { 6 | hex = hex.slice(1); 7 | } 8 | 9 | if (hex.length === 3) { 10 | hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; 11 | } 12 | 13 | color = parseInt(hex, 16); 14 | } else { 15 | color = hex; 16 | } 17 | 18 | return [ 19 | (color & 0xff0000) >> 16, 20 | (color & 0x00ff00) >> 8, 21 | color & 0x0000ff 22 | ]; 23 | } 24 | 25 | export function hexa(hex, a) { 26 | const [r, g, b] = hex2rgb(hex); 27 | return `rgba(${r}, ${g}, ${b}, ${a})`; 28 | } 29 | -------------------------------------------------------------------------------- /src/wiki/blocks/WButton/i/right-l.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/wiki/blocks/WButton/i/close-10.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/assets/icons/maximize.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Rectangle 8 5 | Created with Sketch. 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/server/api/snapshots.js: -------------------------------------------------------------------------------- 1 | import Path from 'path'; 2 | 3 | import Promise from 'bluebird'; 4 | import _ from 'lodash'; 5 | 6 | export default function Blocks({ Block, Library, logger }) { 7 | return { 8 | async create(req, res) { 9 | let library = new Library(req.body.library); 10 | let block = new Block(library, req.body.block); 11 | 12 | try { 13 | let result = await block.snapshot(); 14 | 15 | res.json({ 16 | result: 'Success', 17 | library: library.name, 18 | block: block.name, 19 | archived: result.archived ? result.archived.toString() : null, 20 | stable: result.stable 21 | }); 22 | } catch (e) { 23 | logger.error(e); 24 | res.status(500).json({ 25 | error: e.message 26 | }); 27 | } 28 | } 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | var webpack = require('webpack'); 2 | 3 | var env = new webpack.DefinePlugin({ 4 | 'process.env': { 5 | 'BROWSER': JSON.stringify(true) 6 | } 7 | }); 8 | 9 | module.exports = { 10 | entry: { 11 | wiki: './src/wiki/router.jsx', 12 | 'w-doc': './src/wiki/blocks/WDoc/WDoc.jsx' 13 | }, 14 | output: { 15 | path: __dirname + "/build/bundles/", 16 | filename: "[name].js" 17 | }, 18 | resolve: { 19 | extensions: ['.js', '.jsx'] 20 | }, 21 | module: { 22 | loaders: [{ 23 | test: /\.jsx?$/, 24 | loader: 'babel-loader' 25 | }, 26 | { 27 | test: /\.less$/, 28 | loader: 'style-loader?singleton!css-loader!autoprefixer-loader!less-loader' 29 | }, 30 | { 31 | test: /\.css$/, 32 | loader: 'style-loader?singleton!css-loader' 33 | }, 34 | { 35 | test: /\.svg$/, 36 | loader: 'svg-url-loader?stripdeclarations' 37 | } 38 | ] 39 | }, 40 | plugins: [env] 41 | }; 42 | -------------------------------------------------------------------------------- /src/wiki/blocks/pages/Projects.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { StyleSheet, css } from 'aphrodite/no-important'; 3 | 4 | const s = StyleSheet.create({ 5 | projects: { 6 | flexGrow: 1 7 | } 8 | }); 9 | 10 | export default class Projects extends React.Component { 11 | handleLoad = event => { 12 | let routePath = '/docs'; 13 | let projectPath = event.target.contentWindow.location.pathname; 14 | 15 | this.props.history.replaceState(null, routePath + projectPath); 16 | } 17 | 18 | shouldComponentUpdate(nextProps) { 19 | let currentProjectPath = this.refs.frame.contentWindow.location.pathname; 20 | let splat = this.props.match.params.splat; 21 | let nextSplat = nextProps.match.params.splat; 22 | let nextProjectPath = '/projects' + (nextSplat ? '/' + nextSplat : ''); 23 | return currentProjectPath !== nextProjectPath; 24 | } 25 | 26 | render() { 27 | let splat = this.props.match.params.splat; 28 | let rnd = Math.round(Math.random() * 10000000); 29 | let path = '/projects' + (splat ? '/' + splat : '') + '?rnd=' + rnd; 30 | return