-
Notifications
You must be signed in to change notification settings - Fork 109
Conversation
@teryaew, all commits will be squashed on merge |
@@ -0,0 +1,29 @@ | |||
import { Component, PropTypes as Type } from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не понял зачем мы переопределяем этот компонент. Вроде он такой же без изменений лежит в styleguidist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GREENpoint, https://github.com/styleguidist/react-styleguidist/blob/master/src/rsg-components/Preview/Preview.js
this file contains 2 components (one private and one public). We need override both components
@@ -0,0 +1,62 @@ | |||
import React from 'react'; | |||
import DemoSection from '../../demo/demo-section'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю, что не стоит "прикапываться" на старый DemoSection
. У него совсем другая роль - рисовать много DemoSection
в списке одна за другой, поэтому он добавляет странные отступы снизу и сверху блока.
state = { | ||
theme: 'alfa-on-white' | ||
} | ||
render() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Пустая строка между методами.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@GREENpoint , agree
import Radio from '../../src/radio/radio'; | ||
import RadioGroup from '../../src/radio-group/radio-group'; | ||
import FeatherComponent from '../../src/feather/feather'; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я думаю стоит включить проверку eslint
на эти файлы.
import ThemeProvider from '../../src/theme-provider/theme-provider'; | ||
import Radio from '../../src/radio/radio'; | ||
import RadioGroup from '../../src/radio-group/radio-group'; | ||
import FeatherComponent from '../../src/feather/feather'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deprecated компонент.
<ThemeProvider theme={ activeTheme.themeProviderPrefix }> | ||
<div> | ||
<div | ||
style={ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Стоит все-таки вынести в CSS.
]; | ||
const activeTheme = themes.filter(theme => theme.value === this.state.theme)[0]; | ||
return ( | ||
<div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Непонятно зачем обертка, когда можно просто возвращать DemoSection
.
arui-demo/components/preview.jsx
Outdated
import PreviewComponent from './preview-component'; | ||
import PreviewWithThemeSwitcher from './preview-with-theme-switcher'; | ||
|
||
/* eslint-disable react/no-multi-comp */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не уверен, что нужно весь файл копипастить. Возможно нужно просто отнаследоваться и перекрыть метод. И копипаст и наследование одинаково имхо опасно при таком подходе. По-сути это хаковое решение, но насколько я понимаю сейчас это меньшее из зол.
@@ -0,0 +1,7 @@ | |||
webpackJsonp([1],{51:function(e,t,r){!function(t,r){e.exports=r()}(this,function(){"use strict";function classTest(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function removeChildren(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function removeChildrenAndAdd(e,t){return removeChildren(e).appendChild(t)}function elt(e,t,r,n){var i=document.createElement(e);if(r&&(i.className=r),n&&(i.style.cssText=n),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o<t.length;++o)i.appendChild(t[o]);return i}function eltP(e,t,r,n){var i=elt(e,t,r,n);return i.setAttribute("role","presentation"),i}function contains(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)}function activeElt(){var e;try{e=document.activeElement}catch(t){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function addClass(e,t){var r=e.className;classTest(t).test(r)||(e.className+=(r?" ":"")+t)}function joinClasses(e,t){for(var r=e.split(" "),n=0;n<r.length;n++)r[n]&&!classTest(r[n]).test(t)&&(t+=" "+r[n]);return t}function bind(e){var t=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,t)}}function copyObj(e,t,r){t||(t={});for(var n in e)!e.hasOwnProperty(n)||r===!1&&t.hasOwnProperty(n)||(t[n]=e[n]);return t}function countColumn(e,t,r,n,i){null==t&&(t=e.search(/[^\s\u00a0]/),t==-1&&(t=e.length));for(var o=n||0,a=i||0;;){var l=e.indexOf("\t",o);if(l<0||l>=t)return a+(t-o);a+=l-o,a+=r-a%r,o=l+1}}function indexOf(e,t){for(var r=0;r<e.length;++r)if(e[r]==t)return r;return-1}function findColumn(e,t,r){for(var n=0,i=0;;){var o=e.indexOf("\t",n);o==-1&&(o=e.length);var a=o-n;if(o==e.length||i+a>=t)return n+Math.min(a,t-i);if(i+=o-n,i+=r-i%r,n=o+1,i>=t)return n}}function spaceStr(e){for(;E.length<=e;)E.push(lst(E)+" ");return E[e]}function lst(e){return e[e.length-1]}function map(e,t){for(var r=[],n=0;n<e.length;n++)r[n]=t(e[n],n);return r}function insertSorted(e,t,r){for(var n=0,i=r(t);n<e.length&&r(e[n])<=i;)n++;e.splice(n,0,t)}function nothing(){}function createObj(e,t){var r;return Object.create?r=Object.create(e):(nothing.prototype=e,r=new nothing),t&©Obj(t,r),r}function isWordCharBasic(e){return/\w/.test(e)||e>""&&(e.toUpperCase()!=e.toLowerCase()||I.test(e))}function isWordChar(e,t){return t?!!(t.source.indexOf("\\w")>-1&&isWordCharBasic(e))||t.test(e):isWordCharBasic(e)}function isEmpty(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function isExtendingChar(e){return e.charCodeAt(0)>=768&&F.test(e)}function skipExtendingChars(e,t,r){for(;(r<0?t>0:t<e.length)&&isExtendingChar(e.charAt(t));)t+=r;return t}function findFirst(e,t,r){for(;;){if(Math.abs(t-r)<=1)return e(t)?t:r;var n=Math.floor((t+r)/2);e(n)?r=n:t=n}}function Display(e,t,n){var i=this;this.input=n,i.scrollbarFiller=elt("div",null,"CodeMirror-scrollbar-filler"),i.scrollbarFiller.setAttribute("cm-not-content","true"),i.gutterFiller=elt("div",null,"CodeMirror-gutter-filler"),i.gutterFiller.setAttribute("cm-not-content","true"),i.lineDiv=eltP("div",null,"CodeMirror-code"),i.selectionDiv=elt("div",null,null,"position: relative; z-index: 1"),i.cursorDiv=elt("div",null,"CodeMirror-cursors"),i.measure=elt("div",null,"CodeMirror-measure"),i.lineMeasure=elt("div",null,"CodeMirror-measure"),i.lineSpace=eltP("div",[i.measure,i.lineMeasure,i.selectionDiv,i.cursorDiv,i.lineDiv],null,"position: relative; outline: none");var o=eltP("div",[i.lineSpace],"CodeMirror-lines");i.mover=elt("div",[o],null,"position: relative"),i.sizer=elt("div",[i.mover],"CodeMirror-sizer"),i.sizerWidth=null,i.heightForcer=elt("div",null,null,"position: absolute; height: "+A+"px; width: 1px;"),i.gutters=elt("div",null,"CodeMirror-gutters"),i.lineGutter=null,i.scroller=elt("div",[i.sizer,i.heightForcer,i.gutters],"CodeMirror-scroll"),i.scroller.setAttribute("tabIndex","-1"),i.wrapper=elt("div",[i.scrollbarFiller,i.gutterFiller,i.scroller],"CodeMirror"),a&&l<8&&(i.gutters.style.zIndex=-1,i.scroller.style.paddingRight=0),s||r&&v||(i.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(i.wrapper):e(i.wrapper)),i.viewFrom=i.viewTo=t.first,i.reportedViewFrom=i.reportedViewTo=t.first,i.view=[],i.renderedView=null,i.externalMeasured=null,i.viewOffset=0,i.lastWrapHeight=i.lastWrapWidth=0,i.updateLineNumbers=null,i.nativeBarWidth=i.barHeight=i.barWidth=0,i.scrollbarsClipped=!1,i.lineNumWidth=i.lineNumInnerWidth=i.lineNumChars=null,i.alignWidgets=!1,i.cachedCharWidth=i.cachedTextHeight=i.cachedPaddingH=null,i.maxLine=null,i.maxLineLength=0,i.maxLineChanged=!1,i.wheelDX=i.wheelDY=i.wheelStartX=i.wheelStartY=null,i.shift=!1,i.selForContextMenu=null,i.activeTouch=null,n.init(i)}function getLine(e,t){if(t-=e.first,t<0||t>=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var r=e;!r.lines;)for(var n=0;;++n){var i=r.children[n],o=i.chunkSize();if(t<o){r=i;break}t-=o}return r.lines[t]}function getBetween(e,t,r){var n=[],i=t.line;return e.iter(t.line,r.line+1,function(e){var o=e.text;i==r.line&&(o=o.slice(0,r.ch)),i==t.line&&(o=o.slice(t.ch)),n.push(o),++i}),n}function getLines(e,t,r){var n=[];return e.iter(t,r,function(e){n.push(e.text)}),n}function updateLineHeight(e,t){var r=t-e.height;if(r)for(var n=e;n;n=n.parent)n.height+=r}function lineNo(e){if(null==e.parent)return null;for(var t=e.parent,r=indexOf(t.lines,e),n=t.parent;n;t=n,n=n.parent)for(var i=0;n.children[i]!=t;++i)r+=n.children[i].chunkSize();return r+t.first}function lineAtHeight(e,t){var r=e.first;e:do{for(var n=0;n<e.children.length;++n){var i=e.children[n],o=i.height;if(t<o){e=i;continue e}t-=o,r+=i.chunkSize()}return r}while(!e.lines);for(var a=0;a<e.lines.length;++a){var l=e.lines[a],s=l.height;if(t<s)break;t-=s}return r+a}function isLine(e,t){return t>=e.first&&t<e.first+e.size}function lineNumberFor(e,t){return String(e.lineNumberFormatter(t+e.firstLineNumber))}function Pos(e,t,r){return void 0===r&&(r=null),this instanceof Pos?(this.line=e,this.ch=t,void(this.sticky=r)):new Pos(e,t,r)}function cmp(e,t){return e.line-t.line||e.ch-t.ch}function equalCursorPos(e,t){return e.sticky==t.sticky&&0==cmp(e,t)}function copyPos(e){return Pos(e.line,e.ch)}function maxPos(e,t){return cmp(e,t)<0?t:e}function minPos(e,t){return cmp(e,t)<0?e:t}function clipLine(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function clipPos(e,t){if(t.line<e.first)return Pos(e.first,0);var r=e.first+e.size-1;return t.line>r?Pos(r,getLine(e,r).text.length):clipToLen(t,getLine(e,t.line).text.length)}function clipToLen(e,t){var r=e.ch;return null==r||r>t?Pos(e.line,t):r<0?Pos(e.line,0):e}function clipPosArray(e,t){for(var r=[],n=0;n<t.length;n++)r[n]=clipPos(e,t[n]);return r}function seeReadOnlySpans(){B=!0}function seeCollapsedSpans(){z=!0}function MarkedSpan(e,t,r){this.marker=e,this.from=t,this.to=r}function getMarkedSpanFor(e,t){if(e)for(var r=0;r<e.length;++r){var n=e[r];if(n.marker==t)return n}}function removeMarkedSpan(e,t){for(var r,n=0;n<e.length;++n)e[n]!=t&&(r||(r=[])).push(e[n]);return r}function addMarkedSpan(e,t){e.markedSpans=e.markedSpans?e.markedSpans.concat([t]):[t],t.marker.attachLine(e)}function markedSpansBefore(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);if(l||o.from==t&&"bookmark"==a.type&&(!r||!o.marker.insertLeft)){var s=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);(n||(n=[])).push(new MarkedSpan(a,o.from,s?null:o.to))}}return n}function markedSpansAfter(e,t,r){var n;if(e)for(var i=0;i<e.length;++i){var o=e[i],a=o.marker,l=null==o.to||(a.inclusiveRight?o.to>=t:o.to>t);if(l||o.from==t&&"bookmark"==a.type&&(!r||o.marker.insertLeft)){var s=null==o.from||(a.inclusiveLeft?o.from<=t:o.from<t);(n||(n=[])).push(new MarkedSpan(a,s?null:o.from-t,null==o.to?null:o.to-t))}}return n}function stretchSpansOverChange(e,t){if(t.full)return null;var r=isLine(e,t.from.line)&&getLine(e,t.from.line).markedSpans,n=isLine(e,t.to.line)&&getLine(e,t.to.line).markedSpans;if(!r&&!n)return null;var i=t.from.ch,o=t.to.ch,a=0==cmp(t.from,t.to),l=markedSpansBefore(r,i,a),s=markedSpansAfter(n,o,a),c=1==t.text.length,u=lst(t.text).length+(c?i:0);if(l)for(var d=0;d<l.length;++d){var p=l[d];if(null==p.to){var f=getMarkedSpanFor(s,p.marker);f?c&&(p.to=null==f.to?null:f.to+u):p.to=i}}if(s)for(var h=0;h<s.length;++h){var g=s[h];if(null!=g.to&&(g.to+=u),null==g.from){var m=getMarkedSpanFor(l,g.marker);m||(g.from=u,c&&(l||(l=[])).push(g))}else g.from+=u,c&&(l||(l=[])).push(g)}l&&(l=clearEmptySpans(l)),s&&s!=l&&(s=clearEmptySpans(s));var v=[l];if(!c){var y,b=t.text.length-2;if(b>0&&l)for(var x=0;x<l.length;++x)null==l[x].to&&(y||(y=[])).push(new MarkedSpan(l[x].marker,null,null));for(var C=0;C<b;++C)v.push(y);v.push(s)}return v}function clearEmptySpans(e){for(var t=0;t<e.length;++t){var r=e[t];null!=r.from&&r.from==r.to&&r.marker.clearWhenEmpty!==!1&&e.splice(t--,1)}return e.length?e:null}function removeReadOnlyRanges(e,t,r){var n=null;if(e.iter(t.line,r.line+1,function(e){if(e.markedSpans)for(var t=0;t<e.markedSpans.length;++t){var r=e.markedSpans[t].marker;!r.readOnly||n&&indexOf(n,r)!=-1||(n||(n=[])).push(r)}}),!n)return null;for(var i=[{from:t,to:r}],o=0;o<n.length;++o)for(var a=n[o],l=a.find(0),s=0;s<i.length;++s){var c=i[s];if(!(cmp(c.to,l.from)<0||cmp(c.from,l.to)>0)){var u=[s,1],d=cmp(c.from,l.from),p=cmp(c.to,l.to);(d<0||!a.inclusiveLeft&&!d)&&u.push({from:c.from,to:l.from}),(p>0||!a.inclusiveRight&&!p)&&u.push({from:l.to,to:c.to}),i.splice.apply(i,u),s+=u.length-3}}return i}function detachMarkedSpans(e){var t=e.markedSpans;if(t){for(var r=0;r<t.length;++r)t[r].marker.detachLine(e);e.markedSpans=null}}function attachMarkedSpans(e,t){if(t){for(var r=0;r<t.length;++r)t[r].marker.attachLine(e);e.markedSpans=t}}function extraLeft(e){return e.inclusiveLeft?-1:0}function extraRight(e){return e.inclusiveRight?1:0}function compareCollapsedMarkers(e,t){var r=e.lines.length-t.lines.length;if(0!=r)return r;var n=e.find(),i=t.find(),o=cmp(n.from,i.from)||extraLeft(e)-extraLeft(t);if(o)return-o;var a=cmp(n.to,i.to)||extraRight(e)-extraRight(t);return a?a:t.id-e.id}function collapsedSpanAtSide(e,t){var r,n=z&&e.markedSpans;if(n)for(var i=void 0,o=0;o<n.length;++o)i=n[o],i.marker.collapsed&&null==(t?i.from:i.to)&&(!r||compareCollapsedMarkers(r,i.marker)<0)&&(r=i.marker);return r}function collapsedSpanAtStart(e){return collapsedSpanAtSide(e,!0)}function collapsedSpanAtEnd(e){return collapsedSpanAtSide(e,!1)}function conflictingCollapsedRange(e,t,r,n,i){var o=getLine(e,t),a=z&&o.markedSpans;if(a)for(var l=0;l<a.length;++l){var s=a[l];if(s.marker.collapsed){var c=s.marker.find(0),u=cmp(c.from,r)||extraLeft(s.marker)-extraLeft(i),d=cmp(c.to,n)||extraRight(s.marker)-extraRight(i);if(!(u>=0&&d<=0||u<=0&&d>=0)&&(u<=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?cmp(c.to,r)>=0:cmp(c.to,r)>0)||u>=0&&(s.marker.inclusiveRight&&i.inclusiveLeft?cmp(c.from,n)<=0:cmp(c.from,n)<0)))return!0}}}function visualLine(e){for(var t;t=collapsedSpanAtStart(e);)e=t.find(-1,!0).line;return e}function visualLineEnd(e){for(var t;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line;return e}function visualLineContinued(e){for(var t,r;t=collapsedSpanAtEnd(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function visualLineNo(e,t){var r=getLine(e,t),n=visualLine(r);return r==n?t:lineNo(n)}function visualLineEndNo(e,t){if(t>e.lastLine())return t;var r,n=getLine(e,t);if(!lineIsHidden(e,n))return t;for(;r=collapsedSpanAtEnd(n);)n=r.find(1,!0).line;return lineNo(n)+1}function lineIsHidden(e,t){var r=z&&t.markedSpans;if(r)for(var n=void 0,i=0;i<r.length;++i)if(n=r[i],n.marker.collapsed){if(null==n.from)return!0;if(!n.marker.widgetNode&&0==n.from&&n.marker.inclusiveLeft&&lineIsHiddenInner(e,t,n))return!0}}function lineIsHiddenInner(e,t,r){if(null==r.to){var n=r.marker.find(1,!0);return lineIsHiddenInner(e,n.line,getMarkedSpanFor(n.line.markedSpans,r.marker))}if(r.marker.inclusiveRight&&r.to==t.text.length)return!0;for(var i=void 0,o=0;o<t.markedSpans.length;++o)if(i=t.markedSpans[o],i.marker.collapsed&&!i.marker.widgetNode&&i.from==r.to&&(null==i.to||i.to!=r.from)&&(i.marker.inclusiveLeft||r.marker.inclusiveRight)&&lineIsHiddenInner(e,t,i))return!0}function heightAtLine(e){e=visualLine(e);for(var t=0,r=e.parent,n=0;n<r.lines.length;++n){var i=r.lines[n];if(i==e)break;t+=i.height}for(var o=r.parent;o;r=o,o=r.parent)for(var a=0;a<o.children.length;++a){var l=o.children[a];if(l==r)break;t+=l.height}return t}function lineLength(e){if(0==e.height)return 0;for(var t,r=e.text.length,n=e;t=collapsedSpanAtStart(n);){var i=t.find(0,!0);n=i.from.line,r+=i.from.ch-i.to.ch}for(n=e;t=collapsedSpanAtEnd(n);){var o=t.find(0,!0);r-=n.text.length-o.from.ch,n=o.to.line,r+=n.text.length-o.to.ch}return r}function findMaxLine(e){var t=e.display,r=e.doc;t.maxLine=getLine(r,r.first),t.maxLineLength=lineLength(t.maxLine),t.maxLineChanged=!0,r.iter(function(e){var r=lineLength(e);r>t.maxLineLength&&(t.maxLineLength=r,t.maxLine=e)})}function iterateBidiSections(e,t,r,n){if(!e)return n(t,r,"ltr");for(var i=!1,o=0;o<e.length;++o){var a=e[o];(a.from<r&&a.to>t||t==r&&a.to==t)&&(n(Math.max(a.from,t),Math.min(a.to,r),1==a.level?"rtl":"ltr"),i=!0)}i||n(t,r,"ltr")}function getBidiPartAt(e,t,r){var n;R=null;for(var i=0;i<e.length;++i){var o=e[i];if(o.from<t&&o.to>t)return i;o.to==t&&(o.from!=o.to&&"before"==r?n=i:R=i),o.from==t&&(o.from!=o.to&&"before"!=r?n=i:R=i)}return null!=n?n:R}function getOrder(e,t){var r=e.order;return null==r&&(r=e.order=V(e.text,t)),r}function moveCharLogically(e,t,r){var n=skipExtendingChars(e.text,t+r,r);return n<0||n>e.text.length?null:n}function moveLogically(e,t,r){var n=moveCharLogically(e,t.ch,r);return null==n?null:new Pos(t.line,n,r<0?"after":"before")}function endOfLine(e,t,r,n,i){if(e){var o=getOrder(r,t.doc.direction);if(o){var a,l=i<0?lst(o):o[0],s=i<0==(1==l.level),c=s?"after":"before";if(l.level>0){var u=prepareMeasureForLine(t,r);a=i<0?r.text.length-1:0;var d=measureCharPrepared(t,u,a).top;a=findFirst(function(e){return measureCharPrepared(t,u,e).top==d},i<0==(1==l.level)?l.from:l.to-1,a),"before"==c&&(a=moveCharLogically(r,a,1,!0))}else a=i<0?l.to:l.from;return new Pos(n,a,c)}}return new Pos(n,i<0?r.text.length:0,i<0?"before":"after")}function moveVisually(e,t,r,n){var i=getOrder(t,e.doc.direction);if(!i)return moveLogically(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var o=getBidiPartAt(i,r.ch,r.sticky),a=i[o];if("ltr"==e.doc.direction&&a.level%2==0&&(n>0?a.to>r.ch:a.from<r.ch))return moveLogically(t,r,n);var l,s=function(e,r){return moveCharLogically(t,e instanceof Pos?e.ch:e,r)},c=function(r){return e.options.lineWrapping?(l=l||prepareMeasureForLine(e,t),wrappedLineExtentChar(e,t,l,r)):{begin:0,end:t.text.length}},u=c("before"==r.sticky?s(r,-1):r.ch);if("rtl"==e.doc.direction||1==a.level){var d=1==a.level==n<0,p=s(r,d?1:-1);if(null!=p&&(d?p<=a.to&&p<=u.end:p>=a.from&&p>=u.begin)){var f=d?"before":"after";return new Pos(r.line,p,f)}}var h=function(e,t,n){for(var o=function(e,t){return t?new Pos(r.line,s(e,1),"before"):new Pos(r.line,e,"after")};e>=0&&e<i.length;e+=t){var a=i[e],l=t>0==(1!=a.level),c=l?n.begin:s(n.end,-1);if(a.from<=c&&c<a.to)return o(c,l);if(c=l?a.from:s(a.to,-1),n.begin<=c&&c<n.end)return o(c,l)}},g=h(o+n,n,u);if(g)return g;var m=n>0?u.end:s(u.begin,-1);return null==m||n>0&&m==t.text.length||!(g=h(n>0?0:i.length-1,n,c(m)))?null:g}function getHandlers(e,t){return e._handlers&&e._handlers[t]||j}function off(e,t,r){if(e.removeEventListener)e.removeEventListener(t,r,!1);else if(e.detachEvent)e.detachEvent("on"+t,r);else{var n=e._handlers,i=n&&n[t];if(i){var o=indexOf(i,r);o>-1&&(n[t]=i.slice(0,o).concat(i.slice(o+1)))}}}function signal(e,t){var r=getHandlers(e,t);if(r.length)for(var n=Array.prototype.slice.call(arguments,2),i=0;i<r.length;++i)r[i].apply(null,n)}function signalDOMEvent(e,t,r){return"string"==typeof t&&(t={type:t,preventDefault:function(){this.defaultPrevented=!0}}),signal(e,r||t.type,e,t),e_defaultPrevented(t)||t.codemirrorIgnore}function signalCursorActivity(e){var t=e._handlers&&e._handlers.cursorActivity;if(t)for(var r=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),n=0;n<t.length;++n)indexOf(r,t[n])==-1&&r.push(t[n])}function hasHandler(e,t){return getHandlers(e,t).length>0}function eventMixin(e){e.prototype.on=function(e,t){G(this,e,t)},e.prototype.off=function(e,t){off(this,e,t)}}function e_preventDefault(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function e_stopPropagation(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function e_defaultPrevented(e){return null!=e.defaultPrevented?e.defaultPrevented:0==e.returnValue}function e_stop(e){e_preventDefault(e),e_stopPropagation(e)}function e_target(e){return e.target||e.srcElement}function e_button(e){var t=e.which;return null==t&&(1&e.button?t=1:2&e.button?t=3:4&e.button&&(t=2)),y&&e.ctrlKey&&1==t&&(t=3),t}function zeroWidthElement(e){if(null==O){var t=elt("span","");removeChildrenAndAdd(e,elt("span",[t,document.createTextNode("x")])),0!=e.firstChild.offsetHeight&&(O=t.offsetWidth<=1&&t.offsetHeight>2&&!(a&&l<8))}var r=O?elt("span",""):elt("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}function hasBadBidiRects(e){if(null!=P)return P;var t=removeChildrenAndAdd(e,document.createTextNode("AخA")),r=w(t,0,1).getBoundingClientRect(),n=w(t,1,2).getBoundingClientRect();return removeChildren(e),!(!r||r.left==r.right)&&(P=n.right-r.right<3)}function hasBadZoomedRects(e){if(null!=q)return q;var t=removeChildrenAndAdd(e,elt("span","x")),r=t.getBoundingClientRect(),n=w(t,0,1).getBoundingClientRect();return q=Math.abs(r.left-n.left)>1}function defineMode(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),X[e]=t}function defineMIME(e,t){Y[e]=t}function resolveMode(e){if("string"==typeof e&&Y.hasOwnProperty(e))e=Y[e];else if(e&&"string"==typeof e.name&&Y.hasOwnProperty(e.name)){var t=Y[e.name];"string"==typeof t&&(t={name:t}),e=createObj(t,e),e.name=t.name}else{if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return resolveMode("application/xml");if("string"==typeof e&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return resolveMode("application/json")}return"string"==typeof e?{name:e}:e||{name:"null"}}function getMode(e,t){t=resolveMode(t);var r=X[t.name];if(!r)return getMode(e,"text/plain");var n=r(e,t);if(Z.hasOwnProperty(t.name)){var i=Z[t.name];for(var o in i)i.hasOwnProperty(o)&&(n.hasOwnProperty(o)&&(n["_"+o]=n[o]),n[o]=i[o])}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var a in t.modeProps)n[a]=t.modeProps[a];return n}function extendMode(e,t){var r=Z.hasOwnProperty(e)?Z[e]:Z[e]={};copyObj(t,r)}function copyState(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var i=t[n];i instanceof Array&&(i=i.concat([])),r[n]=i}return r}function innerMode(e,t){for(var r;e.innerMode&&(r=e.innerMode(t),r&&r.mode!=e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function startState(e,t,r){return!e.startState||e.startState(t,r)}function highlightLine(e,t,r,n){var i=[e.state.modeGen],o={};runMode(e,t.text,e.doc.mode,r,function(e,t){return i.push(e,t)},o,n);for(var a=function(r){var n=e.state.overlays[r],a=1,l=0;runMode(e,t.text,n.mode,!0,function(e,t){for(var r=a;l<e;){var o=i[a];o>e&&i.splice(a,1,e,i[a+1],o),a+=2,l=Math.min(e,o)}if(t)if(n.opaque)i.splice(r,a-r,e,"overlay "+t),a=r+2;else for(;r<a;r+=2){var s=i[r+1];i[r+1]=(s?s+" ":"")+"overlay "+t}},o)},l=0;l<e.state.overlays.length;++l)a(l);return{styles:i,classes:o.bgClass||o.textClass?o:null}}function getLineStyles(e,t,r){if(!t.styles||t.styles[0]!=e.state.modeGen){var n=getStateBefore(e,lineNo(t)),i=highlightLine(e,t,t.text.length>e.options.maxHighlightLength?copyState(e.doc.mode,n):n);t.stateAfter=n,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.frontier&&e.doc.frontier++}return t.styles}function getStateBefore(e,t,r){var n=e.doc,i=e.display;if(!n.mode.startState)return!0;var o=findStartLine(e,t,r),a=o>n.first&&getLine(n,o-1).stateAfter;return a=a?copyState(n.mode,a):startState(n.mode),n.iter(o,t,function(r){processLine(e,r.text,a);var l=o==t-1||o%5==0||o>=i.viewFrom&&o<i.viewTo;r.stateAfter=l?copyState(n.mode,a):null,++o}),r&&(n.frontier=o),a}function processLine(e,t,r,n){var i=e.doc.mode,o=new Q(t,e.options.tabSize);for(o.start=o.pos=n||0,""==t&&callBlankLine(i,r);!o.eol();)readToken(i,o,r),o.start=o.pos}function callBlankLine(e,t){if(e.blankLine)return e.blankLine(t);if(e.innerMode){var r=innerMode(e,t);return r.mode.blankLine?r.mode.blankLine(r.state):void 0}}function readToken(e,t,r,n){for(var i=0;i<10;i++){n&&(n[0]=innerMode(e,r).mode);var o=e.token(t,r);if(t.pos>t.start)return o}throw new Error("Mode "+e.name+" failed to advance stream.")}function takeToken(e,t,r,n){var i,o=function(e){return{start:d.start,end:d.pos,string:d.current(),type:i||null,state:e?copyState(a.mode,u):u}},a=e.doc,l=a.mode;t=clipPos(a,t);var s,c=getLine(a,t.line),u=getStateBefore(e,t.line,r),d=new Q(c.text,e.options.tabSize);for(n&&(s=[]);(n||d.pos<t.ch)&&!d.eol();)d.start=d.pos,i=readToken(l,d,u),n&&s.push(o(!0));return n?s:o()}function extractLineClasses(e,t){if(e)for(;;){var r=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!r)break;e=e.slice(0,r.index)+e.slice(r.index+r[0].length);var n=r[1]?"bgClass":"textClass";null==t[n]?t[n]=r[2]:new RegExp("(?:^|s)"+r[2]+"(?:$|s)").test(t[n])||(t[n]+=" "+r[2])}return e}function runMode(e,t,r,n,i,o,a){var l=r.flattenSpans;null==l&&(l=e.options.flattenSpans);var s,c=0,u=null,d=new Q(t,e.options.tabSize),p=e.options.addModeClass&&[null];for(""==t&&extractLineClasses(callBlankLine(r,n),o);!d.eol();){if(d.pos>e.options.maxHighlightLength?(l=!1,a&&processLine(e,t,n,d.pos),d.pos=t.length,s=null):s=extractLineClasses(readToken(r,d,n,p),o),p){var f=p[0].name;f&&(s="m-"+(s?f+" "+s:f))}if(!l||u!=s){for(;c<d.start;)c=Math.min(d.start,c+5e3),i(c,u);u=s}d.start=d.pos}for(;c<d.pos;){var h=Math.min(d.pos,c+5e3);i(h,u),c=h}}function findStartLine(e,t,r){for(var n,i,o=e.doc,a=r?-1:t-(e.doc.mode.innerMode?1e3:100),l=t;l>a;--l){if(l<=o.first)return o.first;var s=getLine(o,l-1);if(s.stateAfter&&(!r||l<=o.frontier))return l;var c=countColumn(s.text,null,e.options.tabSize);(null==i||n>c)&&(i=l-1,n=c)}return i}function updateLine(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),null!=e.order&&(e.order=null),detachMarkedSpans(e),attachMarkedSpans(e,r);var i=n?n(e):1;i!=e.height&&updateLineHeight(e,i)}function cleanUpLine(e){e.parent=null,detachMarkedSpans(e)}function interpretTokenStyle(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?re:te;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function buildLineContent(e,t){var r=eltP("span",null,null,s?"padding-right: .1px":null),n={pre:eltP("pre",[r],"CodeMirror-line"),content:r,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(a||s)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o=i?t.rest[i-1]:t.line,l=void 0;n.pos=0,n.addToken=buildToken,hasBadBidiRects(e.display.measure)&&(l=getOrder(o,e.doc.direction))&&(n.addToken=buildTokenBadBidi(n.addToken,l)),n.map=[];var c=t!=e.display.externalMeasured&&lineNo(o);insertLineContent(o,n,getLineStyles(e,o,c)),o.styleClasses&&(o.styleClasses.bgClass&&(n.bgClass=joinClasses(o.styleClasses.bgClass,n.bgClass||"")),o.styleClasses.textClass&&(n.textClass=joinClasses(o.styleClasses.textClass,n.textClass||""))),0==n.map.length&&n.map.push(0,0,n.content.appendChild(zeroWidthElement(e.display.measure))),0==i?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(s){var u=n.content.lastChild;(/\bcm-tab\b/.test(u.className)||u.querySelector&&u.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return signal(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=joinClasses(n.pre.className,n.textClass||"")),n}function defaultSpecialCharPlaceholder(e){var t=elt("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function buildToken(e,t,r,n,i,o,s){if(t){var c,u=e.splitSpaces?splitSpaces(t,e.trailingSpace):t,d=e.cm.state.specialChars,p=!1;if(d.test(t)){c=document.createDocumentFragment();for(var f=0;;){d.lastIndex=f;var h=d.exec(t),g=h?h.index-f:t.length-f;if(g){var m=document.createTextNode(u.slice(f,f+g));a&&l<9?c.appendChild(elt("span",[m])):c.appendChild(m),e.map.push(e.pos,e.pos+g,m),e.col+=g,e.pos+=g}if(!h)break;f+=g+1;var v=void 0;if("\t"==h[0]){var y=e.cm.options.tabSize,b=y-e.col%y;v=c.appendChild(elt("span",spaceStr(b),"cm-tab")),v.setAttribute("role","presentation"),v.setAttribute("cm-text","\t"),e.col+=b}else"\r"==h[0]||"\n"==h[0]?(v=c.appendChild(elt("span","\r"==h[0]?"␍":"","cm-invalidchar")),v.setAttribute("cm-text",h[0]),e.col+=1):(v=e.cm.options.specialCharPlaceholder(h[0]),v.setAttribute("cm-text",h[0]),a&&l<9?c.appendChild(elt("span",[v])):c.appendChild(v),e.col+=1);e.map.push(e.pos,e.pos+1,v),e.pos++}}else e.col+=t.length,c=document.createTextNode(u),e.map.push(e.pos,e.pos+t.length,c),a&&l<9&&(p=!0),e.pos+=t.length;if(e.trailingSpace=32==u.charCodeAt(t.length-1),r||n||i||p||s){var x=r||"";n&&(x+=n),i&&(x+=i);var C=elt("span",[c],x,s);return o&&(C.title=o),e.content.appendChild(C)}e.content.appendChild(c)}}function splitSpaces(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",i=0;i<e.length;i++){var o=e.charAt(i);" "!=o||!r||i!=e.length-1&&32!=e.charCodeAt(i+1)||(o=" "),n+=o,r=" "==o}return n}function buildTokenBadBidi(e,t){return function(r,n,i,o,a,l,s){i=i?i+" cm-force-border":"cm-force-border";for(var c=r.pos,u=c+n.length;;){for(var d=void 0,p=0;p<t.length&&(d=t[p],!(d.to>c&&d.from<=c));p++);if(d.to>=u)return e(r,n,i,o,a,l,s);e(r,n.slice(0,d.to-c),i,o,null,l,s),o=null,n=n.slice(d.to-c),c=d.to}}}function buildCollapsedSpan(e,t,r,n){var i=!n&&r.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!n&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",r.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function insertLineContent(e,t,r){var n=e.markedSpans,i=e.text,o=0;if(n)for(var a,l,s,c,u,d,p,f=i.length,h=0,g=1,m="",v=0;;){if(v==h){s=c=u=d=l="",p=null,v=1/0;for(var y=[],b=void 0,x=0;x<n.length;++x){var C=n[x],w=C.marker;"bookmark"==w.type&&C.from==h&&w.widgetNode?y.push(w):C.from<=h&&(null==C.to||C.to>h||w.collapsed&&C.to==h&&C.from==h)?(null!=C.to&&C.to!=h&&v>C.to&&(v=C.to,c=""),w.className&&(s+=" "+w.className),w.css&&(l=(l?l+";":"")+w.css),w.startStyle&&C.from==h&&(u+=" "+w.startStyle),w.endStyle&&C.to==v&&(b||(b=[])).push(w.endStyle,C.to),w.title&&!d&&(d=w.title),w.collapsed&&(!p||compareCollapsedMarkers(p.marker,w)<0)&&(p=C)):C.from>h&&v>C.from&&(v=C.from)}if(b)for(var S=0;S<b.length;S+=2)b[S+1]==v&&(c+=" "+b[S]);if(!p||p.from==h)for(var k=0;k<y.length;++k)buildCollapsedSpan(t,0,y[k]);if(p&&(p.from||0)==h){if(buildCollapsedSpan(t,(null==p.to?f+1:p.to)-h,p.marker,null==p.from),null==p.to)return;p.to==h&&(p=!1)}}if(h>=f)break;for(var L=Math.min(f,v);;){if(m){var M=h+m.length;if(!p){var T=M>L?m.slice(0,L-h):m;t.addToken(t,T,a?a+s:s,u,h+T.length==v?c:"",d,l)}if(M>=L){m=m.slice(L-h),h=L;break}h=M,u=""}m=i.slice(o,o=r[g++]),a=interpretTokenStyle(r[g++],t.cm.options)}}else for(var O=1;O<r.length;O+=2)t.addToken(t,i.slice(o,o=r[O]),interpretTokenStyle(r[O+1],t.cm.options))}function LineView(e,t,r){this.line=t,this.rest=visualLineContinued(t),this.size=this.rest?lineNo(lst(this.rest))-r+1:1,this.node=this.text=null,this.hidden=lineIsHidden(e,t)}function buildViewArray(e,t,r){for(var n,i=[],o=t;o<r;o=n){var a=new LineView(e.doc,getLine(e.doc,o),o);n=o+a.size,i.push(a)}return i}function pushOperation(e){ne?ne.ops.push(e):e.ownsGroup=ne={ops:[e],delayedCallbacks:[]}}function fireCallbacksForOps(e){var t=e.delayedCallbacks,r=0;do{for(;r<t.length;r++)t[r].call(null);for(var n=0;n<e.ops.length;n++){var i=e.ops[n];if(i.cursorActivityHandlers)for(;i.cursorActivityCalled<i.cursorActivityHandlers.length;)i.cursorActivityHandlers[i.cursorActivityCalled++].call(null,i.cm)}}while(r<t.length)}function finishOperation(e,t){var r=e.ownsGroup;if(r)try{fireCallbacksForOps(r)}finally{ne=null,t(r)}}function signalLater(e,t){var r=getHandlers(e,t);if(r.length){var n,i=Array.prototype.slice.call(arguments,2);ne?n=ne.delayedCallbacks:ie?n=ie:(n=ie=[],setTimeout(fireOrphanDelayed,0));for(var o=function(e){n.push(function(){return r[e].apply(null,i)})},a=0;a<r.length;++a)o(a)}}function fireOrphanDelayed(){var e=ie;ie=null;for(var t=0;t<e.length;++t)e[t]()}function updateLineForChanges(e,t,r,n){for(var i=0;i<t.changes.length;i++){var o=t.changes[i];"text"==o?updateLineText(e,t):"gutter"==o?updateLineGutter(e,t,r,n):"class"==o?updateLineClasses(e,t):"widget"==o&&updateLineWidgets(e,t,n)}t.changes=null}function ensureLineWrapped(e){return e.node==e.text&&(e.node=elt("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),a&&l<8&&(e.node.style.zIndex=2)),e.node}function updateLineBackground(e,t){var r=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(r&&(r+=" CodeMirror-linebackground"),t.background)r?t.background.className=r:(t.background.parentNode.removeChild(t.background),t.background=null);else if(r){var n=ensureLineWrapped(t);t.background=n.insertBefore(elt("div",null,r),n.firstChild),e.display.input.setUneditable(t.background)}}function getLineContent(e,t){var r=e.display.externalMeasured;return r&&r.line==t.line?(e.display.externalMeasured=null,t.measure=r.measure,r.built):buildLineContent(e,t)}function updateLineText(e,t){var r=t.text.className,n=getLineContent(e,t);t.text==t.node&&(t.node=n.pre),t.text.parentNode.replaceChild(n.pre,t.text),t.text=n.pre,n.bgClass!=t.bgClass||n.textClass!=t.textClass?(t.bgClass=n.bgClass,t.textClass=n.textClass,updateLineClasses(e,t)):r&&(t.text.className=r)}function updateLineClasses(e,t){updateLineBackground(e,t),t.line.wrapClass?ensureLineWrapped(t).className=t.line.wrapClass:t.node!=t.text&&(t.node.className="");var r=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=r||""}function updateLineGutter(e,t,r,n){if(t.gutter&&(t.node.removeChild(t.gutter),t.gutter=null),t.gutterBackground&&(t.node.removeChild(t.gutterBackground),t.gutterBackground=null),t.line.gutterClass){var i=ensureLineWrapped(t);t.gutterBackground=elt("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px; width: "+n.gutterTotalWidth+"px"),e.display.input.setUneditable(t.gutterBackground),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var a=ensureLineWrapped(t),l=t.gutter=elt("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?n.fixedPos:-n.gutterTotalWidth)+"px");if(e.display.input.setUneditable(l),a.insertBefore(l,t.text),t.line.gutterClass&&(l.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=l.appendChild(elt("div",lineNumberFor(e.options,r),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+n.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s<e.options.gutters.length;++s){var c=e.options.gutters[s],u=o.hasOwnProperty(c)&&o[c];u&&l.appendChild(elt("div",[u],"CodeMirror-gutter-elt","left: "+n.gutterLeft[c]+"px; width: "+n.gutterWidth[c]+"px"))}}}function updateLineWidgets(e,t,r){t.alignable&&(t.alignable=null);for(var n=t.node.firstChild,i=void 0;n;n=i)i=n.nextSibling,"CodeMirror-linewidget"==n.className&&t.node.removeChild(n); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужно добавить всю сборочную историю в .gitignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Стайлгайдист создает новый файл с хэш именем. его нужно перекоммичмвать
styleguide.config.js
Outdated
'use strict'; | ||
|
||
const path = require('path'); | ||
/* eslint-disable */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Так ты отключаешь eslint
для всего файла. Не думаю, что это хорошее решение, лучше или внести правку или подавить конкретное правило, если оно в данном кейсе нерелевантно.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен
styleguide.config.js
Outdated
/* eslint-disable */ | ||
const ARUI_TEMPLATE = require('arui-presets/webpack.base'); | ||
|
||
const config = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кажется, можно просто экспортнуть без переменной.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Согласен
styleguide.config.js
Outdated
title: 'ARUI FEATHER', | ||
template: path.resolve(__dirname, './arui-demo/demo.html'), | ||
serverPort: 3013, | ||
components: 'src/+(amount|attach|button|calendar|card-input|card-number|checkbox|checkbox-group|collapse|copyright|dropdown|email-input|form|form-field|highlight|icon|input|label)/**/[a-z]*.jsx', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Имхо стоит просто предсобрать сначала по файловой системе спсиок компонентов.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Упростил
styleguide.config.js
Outdated
components: 'src/+(amount|attach|button|calendar|card-input|card-number|checkbox|checkbox-group|collapse|copyright|dropdown|email-input|form|form-field|highlight|icon|input|label)/**/[a-z]*.jsx', | ||
ignore: ['**/*-test.jsx'], | ||
styleguideDir: path.resolve(__dirname, './arui-demo/styleguide/'), | ||
webpackConfig: Object.assign({}, ARUI_TEMPLATE, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Можно использовать spread operator.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Насколько знаю, нет
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Heymdall а webpack merge здесь не лучшее решение?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, хорошо подойдет. Никаких фич его тут не надо, но можно заиспользовать
arui-demo/components/preview.jsx
Outdated
|
||
|
||
export default class Preview extends StyleguidistPreview { | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
**
arui-demo/demo.html
Outdated
@@ -0,0 +1,11 @@ | |||
<html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
doctype
arui-demo/demo.html
Outdated
<head> | ||
<meta charset="utf-8" /> | ||
<title><%=htmlWebpackPlugin.options.title%></title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maximum-scale
arui-demo/components/logo.jsx
Outdated
@@ -0,0 +1,7 @@ | |||
import * as React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А зачем такой сложный import?
|
||
&_theme_alfa-on-white { | ||
color: #000; | ||
border: solid 1px #eee; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я думаю раз это дублируется можно просто вынести из модификатора.
static propTypes = { | ||
children: Type.oneOfType([Type.arrayOf(Type.node), Type.node]) | ||
}; | ||
state = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Стоит добавить отступы между блоками. Это облегчает чтение.
@@ -0,0 +1,41 @@ | |||
.preview-with-theme-switcher { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
На каждый наш файлик нужно навешивать лицензию. Можно посмотреть на лицензии в файлах ./src/
} | ||
|
||
renderThemeText(theme) { | ||
return theme === lightTheme ? 'светлая' : 'темная'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Мне, кажется, здесь есть небольшая проблема. Когда человек в первый раз открывает сраницу и видит "светлая" / "темная" он не понимает контекст, что это тема. Стоит либо добавить тайтл "Тема" или просто перефразировать "На светлом" / "На темном".
@@ -0,0 +1,11 @@ | |||
<!doctype html> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DOCTYPE case sensitive http://stackoverflow.com/questions/7020961/uppercase-or-lowercase-doctype
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Генерится стайлгайдистом
<head> | ||
<meta charset="utf-8"> | ||
<title>ARUI FEATHER</title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maximum-scale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Генерится стайлгайдистом
@stepancar Есть вопросы по теме коммита:
отсюда: https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#subject |
@teryaew , поправил тему мерджа. При мердже сосквошу |
added styleguidist demo, added md files for several components