decidim-api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -1
- data/vendor/assets/javascripts/decidim/api/graphql-docs.js +3518 -0
- data/vendor/assets/javascripts/decidim/api/react-dom.js +42 -0
- data/vendor/assets/javascripts/decidim/api/react.js +20595 -0
- metadata +12 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ffdaf574e6187c65b307fff6a4af95357b05ab8
|
4
|
+
data.tar.gz: 38015f8c99811f27c8b23f54947adf99a4882bd9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9735699184e7c9342f3bd35d2cf3de757bdb56e16ae64474999253af4ba0edb1d670d809a1d6657c486680593e507dfa5297f72b570006085b9fbb504e4863d4
|
7
|
+
data.tar.gz: ba36b1c10378361484fed78c55ac44f031539810f5f6dce7cb1c9715ba9ea92613f21d141ae60b78842ed9d3207b3c2f5f5498f126a34df5e01782578da2f8cf
|
data/Rakefile
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require "decidim/common_rake"
|
2
|
+
require "decidim/dev/common_rake"
|
@@ -0,0 +1,3518 @@
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
3
|
+
module.exports = factory(require("react"));
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
5
|
+
define(["react"], factory);
|
6
|
+
else if(typeof exports === 'object')
|
7
|
+
exports["GraphQLDocs"] = factory(require("react"));
|
8
|
+
else
|
9
|
+
root["GraphQLDocs"] = factory(root["React"]);
|
10
|
+
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__) {
|
11
|
+
return /******/ (function(modules) { // webpackBootstrap
|
12
|
+
/******/ // The module cache
|
13
|
+
/******/ var installedModules = {};
|
14
|
+
/******/
|
15
|
+
/******/ // The require function
|
16
|
+
/******/ function __webpack_require__(moduleId) {
|
17
|
+
/******/
|
18
|
+
/******/ // Check if module is in cache
|
19
|
+
/******/ if(installedModules[moduleId])
|
20
|
+
/******/ return installedModules[moduleId].exports;
|
21
|
+
/******/
|
22
|
+
/******/ // Create a new module (and put it into the cache)
|
23
|
+
/******/ var module = installedModules[moduleId] = {
|
24
|
+
/******/ exports: {},
|
25
|
+
/******/ id: moduleId,
|
26
|
+
/******/ loaded: false
|
27
|
+
/******/ };
|
28
|
+
/******/
|
29
|
+
/******/ // Execute the module function
|
30
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
31
|
+
/******/
|
32
|
+
/******/ // Flag the module as loaded
|
33
|
+
/******/ module.loaded = true;
|
34
|
+
/******/
|
35
|
+
/******/ // Return the exports of the module
|
36
|
+
/******/ return module.exports;
|
37
|
+
/******/ }
|
38
|
+
/******/
|
39
|
+
/******/
|
40
|
+
/******/ // expose the modules object (__webpack_modules__)
|
41
|
+
/******/ __webpack_require__.m = modules;
|
42
|
+
/******/
|
43
|
+
/******/ // expose the module cache
|
44
|
+
/******/ __webpack_require__.c = installedModules;
|
45
|
+
/******/
|
46
|
+
/******/ // __webpack_public_path__
|
47
|
+
/******/ __webpack_require__.p = "";
|
48
|
+
/******/
|
49
|
+
/******/ // Load entry module and return exports
|
50
|
+
/******/ return __webpack_require__(0);
|
51
|
+
/******/ })
|
52
|
+
/************************************************************************/
|
53
|
+
/******/ ([
|
54
|
+
/* 0 */
|
55
|
+
/***/ function(module, exports, __webpack_require__) {
|
56
|
+
|
57
|
+
'use strict';
|
58
|
+
|
59
|
+
Object.defineProperty(exports, "__esModule", {
|
60
|
+
value: true
|
61
|
+
});
|
62
|
+
exports.GraphQLDocs = undefined;
|
63
|
+
|
64
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
65
|
+
|
66
|
+
var _react = __webpack_require__(1);
|
67
|
+
|
68
|
+
var _react2 = _interopRequireDefault(_react);
|
69
|
+
|
70
|
+
var _SchemaDocsView = __webpack_require__(2);
|
71
|
+
|
72
|
+
var _model = __webpack_require__(3);
|
73
|
+
|
74
|
+
var _introspectionQuery = __webpack_require__(30);
|
75
|
+
|
76
|
+
var _introspectionQuery2 = _interopRequireDefault(_introspectionQuery);
|
77
|
+
|
78
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
79
|
+
|
80
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
81
|
+
|
82
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
83
|
+
|
84
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
85
|
+
|
86
|
+
var GraphQLDocs = exports.GraphQLDocs = function (_React$Component) {
|
87
|
+
_inherits(GraphQLDocs, _React$Component);
|
88
|
+
|
89
|
+
function GraphQLDocs() {
|
90
|
+
_classCallCheck(this, GraphQLDocs);
|
91
|
+
|
92
|
+
return _possibleConstructorReturn(this, (GraphQLDocs.__proto__ || Object.getPrototypeOf(GraphQLDocs)).apply(this, arguments));
|
93
|
+
}
|
94
|
+
|
95
|
+
_createClass(GraphQLDocs, [{
|
96
|
+
key: 'componentWillMount',
|
97
|
+
value: function componentWillMount() {
|
98
|
+
var _this2 = this;
|
99
|
+
|
100
|
+
var promise = this.props.fetcher(_introspectionQuery2.default);
|
101
|
+
|
102
|
+
promise.then(function (json) {
|
103
|
+
_this2.setState({
|
104
|
+
schema: new _model.Schema(json.data)
|
105
|
+
});
|
106
|
+
});
|
107
|
+
}
|
108
|
+
}, {
|
109
|
+
key: 'render',
|
110
|
+
value: function render() {
|
111
|
+
if (this.state && this.state.schema) {
|
112
|
+
return _react2.default.createElement(_SchemaDocsView.SchemaDocsView, { schema: this.state.schema });
|
113
|
+
} else {
|
114
|
+
return _react2.default.createElement('div', null);
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}]);
|
118
|
+
|
119
|
+
return GraphQLDocs;
|
120
|
+
}(_react2.default.Component);
|
121
|
+
|
122
|
+
/***/ },
|
123
|
+
/* 1 */
|
124
|
+
/***/ function(module, exports) {
|
125
|
+
|
126
|
+
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
|
127
|
+
|
128
|
+
/***/ },
|
129
|
+
/* 2 */
|
130
|
+
/***/ function(module, exports, __webpack_require__) {
|
131
|
+
|
132
|
+
'use strict';
|
133
|
+
|
134
|
+
Object.defineProperty(exports, "__esModule", {
|
135
|
+
value: true
|
136
|
+
});
|
137
|
+
exports.SchemaDocsView = undefined;
|
138
|
+
|
139
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
140
|
+
|
141
|
+
var _react = __webpack_require__(1);
|
142
|
+
|
143
|
+
var _react2 = _interopRequireDefault(_react);
|
144
|
+
|
145
|
+
var _model = __webpack_require__(3);
|
146
|
+
|
147
|
+
var _schemaWalker = __webpack_require__(4);
|
148
|
+
|
149
|
+
var _TypeDocsViews = __webpack_require__(5);
|
150
|
+
|
151
|
+
var _SchemaDocsView = __webpack_require__(27);
|
152
|
+
|
153
|
+
var StyleSheet = _interopRequireWildcard(_SchemaDocsView);
|
154
|
+
|
155
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
156
|
+
|
157
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
158
|
+
|
159
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
160
|
+
|
161
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
162
|
+
|
163
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
164
|
+
|
165
|
+
var SchemaDocsView = exports.SchemaDocsView = function (_React$Component) {
|
166
|
+
_inherits(SchemaDocsView, _React$Component);
|
167
|
+
|
168
|
+
function SchemaDocsView() {
|
169
|
+
_classCallCheck(this, SchemaDocsView);
|
170
|
+
|
171
|
+
return _possibleConstructorReturn(this, (SchemaDocsView.__proto__ || Object.getPrototypeOf(SchemaDocsView)).apply(this, arguments));
|
172
|
+
}
|
173
|
+
|
174
|
+
_createClass(SchemaDocsView, [{
|
175
|
+
key: 'render',
|
176
|
+
value: function render() {
|
177
|
+
var _this2 = this;
|
178
|
+
|
179
|
+
var types = (0, _schemaWalker.getReferencesInSchema)(this.props.schema).map(function (tn) {
|
180
|
+
return _this2.props.schema.types[tn];
|
181
|
+
});
|
182
|
+
var components = [];
|
183
|
+
|
184
|
+
types.forEach(function (t) {
|
185
|
+
if (t instanceof _model.ObjectType) {
|
186
|
+
components.push(_react2.default.createElement(_TypeDocsViews.ObjectDocsView, {
|
187
|
+
key: t.name,
|
188
|
+
type: t,
|
189
|
+
titleOverride: _this2.titleOverrideFor(t)
|
190
|
+
}));
|
191
|
+
}
|
192
|
+
if (t instanceof _model.InterfaceType) {
|
193
|
+
components.push(_react2.default.createElement(_TypeDocsViews.InterfaceDocsView, {
|
194
|
+
key: t.name,
|
195
|
+
type: t
|
196
|
+
}));
|
197
|
+
}
|
198
|
+
if (t instanceof _model.EnumType) {
|
199
|
+
components.push(_react2.default.createElement(_TypeDocsViews.EnumDocsView, {
|
200
|
+
key: t.name,
|
201
|
+
type: t
|
202
|
+
}));
|
203
|
+
}
|
204
|
+
if (t instanceof _model.InputObjectType) {
|
205
|
+
components.push(_react2.default.createElement(_TypeDocsViews.InputObjectDocsView, {
|
206
|
+
key: t.name,
|
207
|
+
type: t
|
208
|
+
}));
|
209
|
+
}
|
210
|
+
});
|
211
|
+
types.forEach(function (t) {
|
212
|
+
if (t instanceof _model.ScalarType) {
|
213
|
+
components.push(_react2.default.createElement(_TypeDocsViews.ScalarDocsView, {
|
214
|
+
key: t.name,
|
215
|
+
type: t
|
216
|
+
}));
|
217
|
+
}
|
218
|
+
});
|
219
|
+
|
220
|
+
return _react2.default.createElement(
|
221
|
+
'div',
|
222
|
+
{ className: StyleSheet.wrapper },
|
223
|
+
_react2.default.createElement(
|
224
|
+
'div',
|
225
|
+
{ className: StyleSheet.container },
|
226
|
+
components
|
227
|
+
)
|
228
|
+
);
|
229
|
+
}
|
230
|
+
}, {
|
231
|
+
key: 'titleOverrideFor',
|
232
|
+
value: function titleOverrideFor(t) {
|
233
|
+
if (t === this.props.schema.getQueryType()) {
|
234
|
+
return 'Root query';
|
235
|
+
}
|
236
|
+
if (t === this.props.schema.getMutationType()) {
|
237
|
+
return 'Mutations';
|
238
|
+
}
|
239
|
+
|
240
|
+
return null;
|
241
|
+
}
|
242
|
+
}]);
|
243
|
+
|
244
|
+
return SchemaDocsView;
|
245
|
+
}(_react2.default.Component);
|
246
|
+
|
247
|
+
/***/ },
|
248
|
+
/* 3 */
|
249
|
+
/***/ function(module, exports) {
|
250
|
+
|
251
|
+
'use strict';
|
252
|
+
|
253
|
+
Object.defineProperty(exports, "__esModule", {
|
254
|
+
value: true
|
255
|
+
});
|
256
|
+
|
257
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
258
|
+
|
259
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
260
|
+
|
261
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
262
|
+
|
263
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
264
|
+
|
265
|
+
var TYPE_KINDS = exports.TYPE_KINDS = ['SCALAR', 'INTERFACE', 'OBJECT', 'ENUM', 'INPUT_OBJECT'];
|
266
|
+
|
267
|
+
var Schema = exports.Schema = function () {
|
268
|
+
function Schema(introspectionResult) {
|
269
|
+
var _this = this;
|
270
|
+
|
271
|
+
_classCallCheck(this, Schema);
|
272
|
+
|
273
|
+
if (!introspectionResult.__schema) {
|
274
|
+
throw new Error('Function "Schema" precondition failed: introspectionResult.__schema');
|
275
|
+
}
|
276
|
+
|
277
|
+
if (!Array.isArray(introspectionResult.__schema.types)) {
|
278
|
+
throw new Error('Function "Schema" precondition failed: Array.isArray(introspectionResult.__schema.types)');
|
279
|
+
}
|
280
|
+
|
281
|
+
if (!introspectionResult.__schema.queryType) {
|
282
|
+
throw new Error('Function "Schema" precondition failed: introspectionResult.__schema.queryType');
|
283
|
+
}
|
284
|
+
|
285
|
+
if (!(introspectionResult.__schema.mutationType === null || typeof introspectionResult.__schema.mutationType.name === 'string')) {
|
286
|
+
throw new Error('Function "Schema" precondition failed: introspectionResult.__schema.mutationType === null || typeof introspectionResult.__schema.mutationType.name === \'string\'');
|
287
|
+
}
|
288
|
+
|
289
|
+
this.types = {};
|
290
|
+
introspectionResult.__schema.types.forEach(function (t) {
|
291
|
+
if (!(typeof t.name === 'string')) {
|
292
|
+
throw new Error('Function precondition failed: typeof t.name === \'string\'');
|
293
|
+
}
|
294
|
+
|
295
|
+
_this.types[t.name] = Type.fromIntrospectionType(t);
|
296
|
+
});
|
297
|
+
|
298
|
+
this.queryTypeId = introspectionResult.__schema.queryType.name;
|
299
|
+
|
300
|
+
if (introspectionResult.__schema.mutationType) {
|
301
|
+
this.mutationTypeId = introspectionResult.__schema.mutationType.name;
|
302
|
+
} else {
|
303
|
+
this.mutationTypeId = null;
|
304
|
+
}
|
305
|
+
}
|
306
|
+
|
307
|
+
_createClass(Schema, [{
|
308
|
+
key: 'getQueryType',
|
309
|
+
value: function getQueryType() {
|
310
|
+
var queryType = this.types[this.queryTypeId];
|
311
|
+
|
312
|
+
if (queryType instanceof ObjectType) {
|
313
|
+
return queryType;
|
314
|
+
} else {
|
315
|
+
throw new Error('Query type must be an ObjectType');
|
316
|
+
}
|
317
|
+
}
|
318
|
+
}, {
|
319
|
+
key: 'getMutationType',
|
320
|
+
value: function getMutationType() {
|
321
|
+
if (!this.mutationTypeId) {
|
322
|
+
return null;
|
323
|
+
}
|
324
|
+
|
325
|
+
var mutationType = this.types[this.mutationTypeId];
|
326
|
+
|
327
|
+
if (mutationType instanceof ObjectType) {
|
328
|
+
return mutationType;
|
329
|
+
} else {
|
330
|
+
throw new Error('Mutation type must be an ObjectType');
|
331
|
+
}
|
332
|
+
}
|
333
|
+
}]);
|
334
|
+
|
335
|
+
return Schema;
|
336
|
+
}();
|
337
|
+
|
338
|
+
var Type = exports.Type = function () {
|
339
|
+
_createClass(Type, null, [{
|
340
|
+
key: 'fromIntrospectionType',
|
341
|
+
value: function fromIntrospectionType(introspectionType) {
|
342
|
+
if (introspectionType.kind === 'OBJECT') {
|
343
|
+
return new ObjectType(introspectionType);
|
344
|
+
} else if (introspectionType.kind === 'SCALAR') {
|
345
|
+
return new ScalarType(introspectionType);
|
346
|
+
} else if (introspectionType.kind === 'INTERFACE') {
|
347
|
+
return new InterfaceType(introspectionType);
|
348
|
+
} else if (introspectionType.kind === 'ENUM') {
|
349
|
+
return new EnumType(introspectionType);
|
350
|
+
} else if (introspectionType.kind === 'INPUT_OBJECT') {
|
351
|
+
return new InputObjectType(introspectionType);
|
352
|
+
} else {
|
353
|
+
throw new Error('Unsupported type kind: ' + introspectionType.kind);
|
354
|
+
}
|
355
|
+
}
|
356
|
+
}]);
|
357
|
+
|
358
|
+
function Type(introspectionType) {
|
359
|
+
_classCallCheck(this, Type);
|
360
|
+
|
361
|
+
if (!(this.constructor !== Type)) {
|
362
|
+
throw new Error('Function "Type" precondition failed: this.constructor !== Type');
|
363
|
+
}
|
364
|
+
|
365
|
+
if (!(typeof introspectionType.name === 'string')) {
|
366
|
+
throw new Error('Function "Type" precondition failed: typeof introspectionType.name === \'string\'');
|
367
|
+
}
|
368
|
+
|
369
|
+
if (!(introspectionType.description === null || typeof introspectionType.description === 'string')) {
|
370
|
+
throw new Error('Function "Type" precondition failed: introspectionType.description === null || typeof introspectionType.description === \'string\'');
|
371
|
+
}
|
372
|
+
|
373
|
+
this.name = introspectionType.name;
|
374
|
+
this.description = introspectionType.description;
|
375
|
+
}
|
376
|
+
|
377
|
+
return Type;
|
378
|
+
}();
|
379
|
+
|
380
|
+
var ObjectType = exports.ObjectType = function (_Type) {
|
381
|
+
_inherits(ObjectType, _Type);
|
382
|
+
|
383
|
+
function ObjectType(introspectionType) {
|
384
|
+
_classCallCheck(this, ObjectType);
|
385
|
+
|
386
|
+
if (!(introspectionType.kind === 'OBJECT')) {
|
387
|
+
throw new Error('Function "ObjectType" precondition failed: introspectionType.kind === \'OBJECT\'');
|
388
|
+
}
|
389
|
+
|
390
|
+
if (!Array.isArray(introspectionType.fields)) {
|
391
|
+
throw new Error('Function "ObjectType" precondition failed: Array.isArray(introspectionType.fields)');
|
392
|
+
}
|
393
|
+
|
394
|
+
if (!(introspectionType.interfaces === null || Array.isArray(introspectionType.interfaces))) {
|
395
|
+
throw new Error('Function "ObjectType" precondition failed: introspectionType.interfaces === null || Array.isArray(introspectionType.interfaces)');
|
396
|
+
}
|
397
|
+
|
398
|
+
var _this2 = _possibleConstructorReturn(this, (ObjectType.__proto__ || Object.getPrototypeOf(ObjectType)).call(this, introspectionType));
|
399
|
+
|
400
|
+
_this2.fields = introspectionType.fields.map(function (f) {
|
401
|
+
return new Field(f);
|
402
|
+
});
|
403
|
+
|
404
|
+
if (introspectionType.interfaces) {
|
405
|
+
_this2.interfaces = introspectionType.interfaces.map(function (r) {
|
406
|
+
return TypeRef.fromIntrospectionRef(r);
|
407
|
+
});
|
408
|
+
} else {
|
409
|
+
_this2.interfaces = [];
|
410
|
+
}
|
411
|
+
return _this2;
|
412
|
+
}
|
413
|
+
|
414
|
+
return ObjectType;
|
415
|
+
}(Type);
|
416
|
+
|
417
|
+
var ScalarType = exports.ScalarType = function (_Type2) {
|
418
|
+
_inherits(ScalarType, _Type2);
|
419
|
+
|
420
|
+
function ScalarType(introspectionType) {
|
421
|
+
_classCallCheck(this, ScalarType);
|
422
|
+
|
423
|
+
if (!(introspectionType.kind === 'SCALAR')) {
|
424
|
+
throw new Error('Function "ScalarType" precondition failed: introspectionType.kind === \'SCALAR\'');
|
425
|
+
}
|
426
|
+
|
427
|
+
return _possibleConstructorReturn(this, (ScalarType.__proto__ || Object.getPrototypeOf(ScalarType)).call(this, introspectionType));
|
428
|
+
}
|
429
|
+
|
430
|
+
return ScalarType;
|
431
|
+
}(Type);
|
432
|
+
|
433
|
+
var InterfaceType = exports.InterfaceType = function (_Type3) {
|
434
|
+
_inherits(InterfaceType, _Type3);
|
435
|
+
|
436
|
+
function InterfaceType(introspectionType) {
|
437
|
+
_classCallCheck(this, InterfaceType);
|
438
|
+
|
439
|
+
if (!(introspectionType.kind === 'INTERFACE')) {
|
440
|
+
throw new Error('Function "InterfaceType" precondition failed: introspectionType.kind === \'INTERFACE\'');
|
441
|
+
}
|
442
|
+
|
443
|
+
if (!Array.isArray(introspectionType.fields)) {
|
444
|
+
throw new Error('Function "InterfaceType" precondition failed: Array.isArray(introspectionType.fields)');
|
445
|
+
}
|
446
|
+
|
447
|
+
if (!Array.isArray(introspectionType.possibleTypes)) {
|
448
|
+
throw new Error('Function "InterfaceType" precondition failed: Array.isArray(introspectionType.possibleTypes)');
|
449
|
+
}
|
450
|
+
|
451
|
+
var _this4 = _possibleConstructorReturn(this, (InterfaceType.__proto__ || Object.getPrototypeOf(InterfaceType)).call(this, introspectionType));
|
452
|
+
|
453
|
+
_this4.fields = introspectionType.fields.map(function (f) {
|
454
|
+
return new Field(f);
|
455
|
+
});
|
456
|
+
_this4.possibleTypes = introspectionType.possibleTypes.map(function (r) {
|
457
|
+
return TypeRef.fromIntrospectionRef(r);
|
458
|
+
});
|
459
|
+
return _this4;
|
460
|
+
}
|
461
|
+
|
462
|
+
return InterfaceType;
|
463
|
+
}(Type);
|
464
|
+
|
465
|
+
var EnumType = exports.EnumType = function (_Type4) {
|
466
|
+
_inherits(EnumType, _Type4);
|
467
|
+
|
468
|
+
function EnumType(introspectionType) {
|
469
|
+
_classCallCheck(this, EnumType);
|
470
|
+
|
471
|
+
if (!(introspectionType.kind === 'ENUM')) {
|
472
|
+
throw new Error('Function "EnumType" precondition failed: introspectionType.kind === \'ENUM\'');
|
473
|
+
}
|
474
|
+
|
475
|
+
if (!Array.isArray(introspectionType.enumValues)) {
|
476
|
+
throw new Error('Function "EnumType" precondition failed: Array.isArray(introspectionType.enumValues)');
|
477
|
+
}
|
478
|
+
|
479
|
+
var _this5 = _possibleConstructorReturn(this, (EnumType.__proto__ || Object.getPrototypeOf(EnumType)).call(this, introspectionType));
|
480
|
+
|
481
|
+
_this5.enumValues = introspectionType.enumValues.map(function (v) {
|
482
|
+
return new EnumValue(v);
|
483
|
+
});
|
484
|
+
return _this5;
|
485
|
+
}
|
486
|
+
|
487
|
+
return EnumType;
|
488
|
+
}(Type);
|
489
|
+
|
490
|
+
var InputObjectType = exports.InputObjectType = function (_Type5) {
|
491
|
+
_inherits(InputObjectType, _Type5);
|
492
|
+
|
493
|
+
function InputObjectType(introspectionType) {
|
494
|
+
_classCallCheck(this, InputObjectType);
|
495
|
+
|
496
|
+
if (!(introspectionType.kind === 'INPUT_OBJECT')) {
|
497
|
+
throw new Error('Function "InputObjectType" precondition failed: introspectionType.kind === \'INPUT_OBJECT\'');
|
498
|
+
}
|
499
|
+
|
500
|
+
if (!Array.isArray(introspectionType.inputFields)) {
|
501
|
+
throw new Error('Function "InputObjectType" precondition failed: Array.isArray(introspectionType.inputFields)');
|
502
|
+
}
|
503
|
+
|
504
|
+
var _this6 = _possibleConstructorReturn(this, (InputObjectType.__proto__ || Object.getPrototypeOf(InputObjectType)).call(this, introspectionType));
|
505
|
+
|
506
|
+
_this6.inputFields = introspectionType.inputFields.map(function (f) {
|
507
|
+
return new InputValue(f);
|
508
|
+
});
|
509
|
+
return _this6;
|
510
|
+
}
|
511
|
+
|
512
|
+
return InputObjectType;
|
513
|
+
}(Type);
|
514
|
+
|
515
|
+
var Field = exports.Field = function Field(introspectionField) {
|
516
|
+
_classCallCheck(this, Field);
|
517
|
+
|
518
|
+
if (!(typeof introspectionField.name === 'string')) {
|
519
|
+
throw new Error('Function "Field" precondition failed: typeof introspectionField.name === \'string\'');
|
520
|
+
}
|
521
|
+
|
522
|
+
if (!(introspectionField.description === null || typeof introspectionField.description === 'string')) {
|
523
|
+
throw new Error('Function "Field" precondition failed: introspectionField.description === null || typeof introspectionField.description === \'string\'');
|
524
|
+
}
|
525
|
+
|
526
|
+
if (!introspectionField.type) {
|
527
|
+
throw new Error('Function "Field" precondition failed: introspectionField.type');
|
528
|
+
}
|
529
|
+
|
530
|
+
if (!Array.isArray(introspectionField.args)) {
|
531
|
+
throw new Error('Function "Field" precondition failed: Array.isArray(introspectionField.args)');
|
532
|
+
}
|
533
|
+
|
534
|
+
this.name = introspectionField.name;
|
535
|
+
this.description = introspectionField.description;
|
536
|
+
this.args = introspectionField.args.map(function (a) {
|
537
|
+
return new InputValue(a);
|
538
|
+
});
|
539
|
+
this.type = TypeRef.fromIntrospectionRef(introspectionField.type);
|
540
|
+
};
|
541
|
+
|
542
|
+
var InputValue = exports.InputValue = function InputValue(introspectionValue) {
|
543
|
+
_classCallCheck(this, InputValue);
|
544
|
+
|
545
|
+
if (!(typeof introspectionValue.name === 'string')) {
|
546
|
+
throw new Error('Function "InputValue" precondition failed: typeof introspectionValue.name === \'string\'');
|
547
|
+
}
|
548
|
+
|
549
|
+
if (!(introspectionValue.description === null || typeof introspectionValue.description === 'string')) {
|
550
|
+
throw new Error('Function "InputValue" precondition failed: introspectionValue.description === null || typeof introspectionValue.description === \'string\'');
|
551
|
+
}
|
552
|
+
|
553
|
+
if (!introspectionValue.type) {
|
554
|
+
throw new Error('Function "InputValue" precondition failed: introspectionValue.type');
|
555
|
+
}
|
556
|
+
|
557
|
+
if (!(introspectionValue.defaultValue !== undefined)) {
|
558
|
+
throw new Error('Function "InputValue" precondition failed: introspectionValue.defaultValue !== undefined');
|
559
|
+
}
|
560
|
+
|
561
|
+
this.name = introspectionValue.name;
|
562
|
+
this.type = TypeRef.fromIntrospectionRef(introspectionValue.type);
|
563
|
+
this.description = introspectionValue.description;
|
564
|
+
this.defaultValue = introspectionValue.defaultValue;
|
565
|
+
};
|
566
|
+
|
567
|
+
var TypeRef = exports.TypeRef = function () {
|
568
|
+
function TypeRef() {
|
569
|
+
_classCallCheck(this, TypeRef);
|
570
|
+
|
571
|
+
if (!(this.constructor !== TypeRef)) {
|
572
|
+
throw new Error('Function "TypeRef" precondition failed: this.constructor !== TypeRef');
|
573
|
+
}
|
574
|
+
}
|
575
|
+
|
576
|
+
_createClass(TypeRef, null, [{
|
577
|
+
key: 'fromIntrospectionRef',
|
578
|
+
value: function fromIntrospectionRef(introspectionRef) {
|
579
|
+
if (introspectionRef.kind === 'NON_NULL') {
|
580
|
+
return new NonNullTypeRef(introspectionRef);
|
581
|
+
} else if (introspectionRef.kind === 'LIST') {
|
582
|
+
return new ListTypeRef(introspectionRef);
|
583
|
+
} else if (TYPE_KINDS.indexOf(introspectionRef.kind) !== -1) {
|
584
|
+
return new NamedTypeRef(introspectionRef);
|
585
|
+
} else {
|
586
|
+
throw new Error('Unsupported type ref kind: ' + introspectionRef.kind);
|
587
|
+
}
|
588
|
+
}
|
589
|
+
}]);
|
590
|
+
|
591
|
+
return TypeRef;
|
592
|
+
}();
|
593
|
+
|
594
|
+
var NonNullTypeRef = exports.NonNullTypeRef = function (_TypeRef) {
|
595
|
+
_inherits(NonNullTypeRef, _TypeRef);
|
596
|
+
|
597
|
+
function NonNullTypeRef(introspectionRef) {
|
598
|
+
_classCallCheck(this, NonNullTypeRef);
|
599
|
+
|
600
|
+
if (!introspectionRef.ofType) {
|
601
|
+
throw new Error('Function "NonNullTypeRef" precondition failed: introspectionRef.ofType');
|
602
|
+
}
|
603
|
+
|
604
|
+
var _this7 = _possibleConstructorReturn(this, (NonNullTypeRef.__proto__ || Object.getPrototypeOf(NonNullTypeRef)).call(this));
|
605
|
+
|
606
|
+
_this7.ofType = TypeRef.fromIntrospectionRef(introspectionRef.ofType);
|
607
|
+
return _this7;
|
608
|
+
}
|
609
|
+
|
610
|
+
return NonNullTypeRef;
|
611
|
+
}(TypeRef);
|
612
|
+
|
613
|
+
var NamedTypeRef = exports.NamedTypeRef = function (_TypeRef2) {
|
614
|
+
_inherits(NamedTypeRef, _TypeRef2);
|
615
|
+
|
616
|
+
function NamedTypeRef(introspectionRef) {
|
617
|
+
_classCallCheck(this, NamedTypeRef);
|
618
|
+
|
619
|
+
if (!(typeof introspectionRef.name === 'string')) {
|
620
|
+
throw new Error('Function "NamedTypeRef" precondition failed: typeof introspectionRef.name === \'string\'');
|
621
|
+
}
|
622
|
+
|
623
|
+
var _this8 = _possibleConstructorReturn(this, (NamedTypeRef.__proto__ || Object.getPrototypeOf(NamedTypeRef)).call(this));
|
624
|
+
|
625
|
+
_this8.typeName = introspectionRef.name;
|
626
|
+
return _this8;
|
627
|
+
}
|
628
|
+
|
629
|
+
return NamedTypeRef;
|
630
|
+
}(TypeRef);
|
631
|
+
|
632
|
+
var ListTypeRef = exports.ListTypeRef = function (_TypeRef3) {
|
633
|
+
_inherits(ListTypeRef, _TypeRef3);
|
634
|
+
|
635
|
+
function ListTypeRef(introspectionRef) {
|
636
|
+
_classCallCheck(this, ListTypeRef);
|
637
|
+
|
638
|
+
if (!introspectionRef.ofType) {
|
639
|
+
throw new Error('Function "ListTypeRef" precondition failed: introspectionRef.ofType');
|
640
|
+
}
|
641
|
+
|
642
|
+
var _this9 = _possibleConstructorReturn(this, (ListTypeRef.__proto__ || Object.getPrototypeOf(ListTypeRef)).call(this));
|
643
|
+
|
644
|
+
_this9.ofType = TypeRef.fromIntrospectionRef(introspectionRef.ofType);
|
645
|
+
return _this9;
|
646
|
+
}
|
647
|
+
|
648
|
+
return ListTypeRef;
|
649
|
+
}(TypeRef);
|
650
|
+
|
651
|
+
var EnumValue = exports.EnumValue = function EnumValue(introspectionValue) {
|
652
|
+
_classCallCheck(this, EnumValue);
|
653
|
+
|
654
|
+
if (!(typeof introspectionValue.name === 'string')) {
|
655
|
+
throw new Error('Function "EnumValue" precondition failed: typeof introspectionValue.name === \'string\'');
|
656
|
+
}
|
657
|
+
|
658
|
+
if (!(introspectionValue.description === null || typeof introspectionValue.description === 'string')) {
|
659
|
+
throw new Error('Function "EnumValue" precondition failed: introspectionValue.description === null || typeof introspectionValue.description === \'string\'');
|
660
|
+
}
|
661
|
+
|
662
|
+
if (!(typeof introspectionValue.isDeprecated === 'boolean')) {
|
663
|
+
throw new Error('Function "EnumValue" precondition failed: typeof introspectionValue.isDeprecated === \'boolean\'');
|
664
|
+
}
|
665
|
+
|
666
|
+
if (!(!introspectionValue.isDeprecated || typeof introspectionValue.deprecationReason === 'string')) {
|
667
|
+
throw new Error('Function "EnumValue" precondition failed: !introspectionValue.isDeprecated || typeof introspectionValue.deprecationReason === \'string\'');
|
668
|
+
}
|
669
|
+
|
670
|
+
if (!(introspectionValue.isDeprecated || introspectionValue.deprecationReason === null)) {
|
671
|
+
throw new Error('Function "EnumValue" precondition failed: introspectionValue.isDeprecated || introspectionValue.deprecationReason === null');
|
672
|
+
}
|
673
|
+
|
674
|
+
this.name = introspectionValue.name;
|
675
|
+
this.description = introspectionValue.description;
|
676
|
+
this.isDeprecated = introspectionValue.isDeprecated;
|
677
|
+
this.deprecationReason = introspectionValue.deprecationReason;
|
678
|
+
};
|
679
|
+
|
680
|
+
/***/ },
|
681
|
+
/* 4 */
|
682
|
+
/***/ function(module, exports, __webpack_require__) {
|
683
|
+
|
684
|
+
'use strict';
|
685
|
+
|
686
|
+
Object.defineProperty(exports, "__esModule", {
|
687
|
+
value: true
|
688
|
+
});
|
689
|
+
exports.getReferencesInSchema = getReferencesInSchema;
|
690
|
+
|
691
|
+
var _model = __webpack_require__(3);
|
692
|
+
|
693
|
+
function getReferencesInSchema(schema) {
|
694
|
+
var visitQueue = [];
|
695
|
+
var visited = [];
|
696
|
+
|
697
|
+
visitQueue.push(schema.getQueryType().name);
|
698
|
+
|
699
|
+
var mutationType = schema.getMutationType();
|
700
|
+
if (mutationType) {
|
701
|
+
visitQueue.push(mutationType.name);
|
702
|
+
}
|
703
|
+
|
704
|
+
while (visitQueue.length) {
|
705
|
+
var typeId = visitQueue.shift();
|
706
|
+
if (visited.indexOf(typeId) !== -1) {
|
707
|
+
continue;
|
708
|
+
}
|
709
|
+
|
710
|
+
var type = schema.types[typeId];
|
711
|
+
|
712
|
+
if (!type) {
|
713
|
+
throw new Error('Type ' + typeId + ' not found in schema');
|
714
|
+
}
|
715
|
+
|
716
|
+
var newRefs = getReferencesInType(type);
|
717
|
+
|
718
|
+
visited.push(typeId);
|
719
|
+
|
720
|
+
[].push.apply(visitQueue, Object.keys(newRefs));
|
721
|
+
}
|
722
|
+
|
723
|
+
return visited;
|
724
|
+
}
|
725
|
+
|
726
|
+
function getReferencesInType(type) {
|
727
|
+
var refs = {};
|
728
|
+
addTypeToBag(type, refs);
|
729
|
+
|
730
|
+
if (type instanceof _model.ObjectType) {
|
731
|
+
type.fields.forEach(function (f) {
|
732
|
+
return getReferencesInField(f, refs);
|
733
|
+
});
|
734
|
+
type.interfaces.forEach(function (r) {
|
735
|
+
return addTypeRefToBag(r, refs);
|
736
|
+
});
|
737
|
+
}
|
738
|
+
|
739
|
+
if (type instanceof _model.InterfaceType) {
|
740
|
+
type.fields.forEach(function (f) {
|
741
|
+
return getReferencesInField(f, refs);
|
742
|
+
});
|
743
|
+
type.possibleTypes.forEach(function (r) {
|
744
|
+
return addTypeRefToBag(r, refs);
|
745
|
+
});
|
746
|
+
}
|
747
|
+
|
748
|
+
if (type instanceof _model.InputObjectType) {
|
749
|
+
type.inputFields.forEach(function (iv) {
|
750
|
+
return addTypeRefToBag(iv.type, refs);
|
751
|
+
});
|
752
|
+
}
|
753
|
+
|
754
|
+
return refs;
|
755
|
+
}
|
756
|
+
|
757
|
+
function getReferencesInField(field, refs) {
|
758
|
+
addTypeRefToBag(field.type, refs);
|
759
|
+
|
760
|
+
field.args.forEach(function (arg) {
|
761
|
+
return addTypeRefToBag(arg.type, refs);
|
762
|
+
});
|
763
|
+
}
|
764
|
+
|
765
|
+
function addTypeRefToBag(typeRef, refs) {
|
766
|
+
if (typeRef instanceof _model.NonNullTypeRef) {
|
767
|
+
addTypeRefToBag(typeRef.ofType, refs);
|
768
|
+
} else if (typeRef instanceof _model.ListTypeRef) {
|
769
|
+
addTypeRefToBag(typeRef.ofType, refs);
|
770
|
+
} else if (typeRef instanceof _model.NamedTypeRef) {
|
771
|
+
refs[typeRef.typeName] = (refs[typeRef.typeName] || 0) + 1;
|
772
|
+
} else {
|
773
|
+
throw new Error('Unknown type ref: ' + typeRef.toString());
|
774
|
+
}
|
775
|
+
}
|
776
|
+
|
777
|
+
function addTypeToBag(type, refs) {
|
778
|
+
refs[type.name] = (refs[type.name] || 0) + 1;
|
779
|
+
}
|
780
|
+
|
781
|
+
/***/ },
|
782
|
+
/* 5 */
|
783
|
+
/***/ function(module, exports, __webpack_require__) {
|
784
|
+
|
785
|
+
'use strict';
|
786
|
+
|
787
|
+
Object.defineProperty(exports, "__esModule", {
|
788
|
+
value: true
|
789
|
+
});
|
790
|
+
exports.InputObjectDocsView = exports.ScalarDocsView = exports.EnumDocsView = exports.InterfaceDocsView = exports.ObjectDocsView = undefined;
|
791
|
+
|
792
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
793
|
+
|
794
|
+
var _react = __webpack_require__(1);
|
795
|
+
|
796
|
+
var _react2 = _interopRequireDefault(_react);
|
797
|
+
|
798
|
+
var _model = __webpack_require__(3);
|
799
|
+
|
800
|
+
var _DescriptionView = __webpack_require__(6);
|
801
|
+
|
802
|
+
var _FieldView = __webpack_require__(12);
|
803
|
+
|
804
|
+
var _TypeRefView = __webpack_require__(14);
|
805
|
+
|
806
|
+
var _FieldArgumentsTableView = __webpack_require__(20);
|
807
|
+
|
808
|
+
var _TypeDocsViews = __webpack_require__(25);
|
809
|
+
|
810
|
+
var StyleSheet = _interopRequireWildcard(_TypeDocsViews);
|
811
|
+
|
812
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
813
|
+
|
814
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
815
|
+
|
816
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
817
|
+
|
818
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
819
|
+
|
820
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
821
|
+
|
822
|
+
var ObjectDocsView = exports.ObjectDocsView = function (_React$Component) {
|
823
|
+
_inherits(ObjectDocsView, _React$Component);
|
824
|
+
|
825
|
+
function ObjectDocsView() {
|
826
|
+
_classCallCheck(this, ObjectDocsView);
|
827
|
+
|
828
|
+
return _possibleConstructorReturn(this, (ObjectDocsView.__proto__ || Object.getPrototypeOf(ObjectDocsView)).apply(this, arguments));
|
829
|
+
}
|
830
|
+
|
831
|
+
_createClass(ObjectDocsView, [{
|
832
|
+
key: 'render',
|
833
|
+
value: function render() {
|
834
|
+
var type = this.props.type;
|
835
|
+
return _react2.default.createElement(
|
836
|
+
'div',
|
837
|
+
{ className: StyleSheet.type },
|
838
|
+
renderTitle(type.name, this.props.titleOverride),
|
839
|
+
renderDescription(type.description),
|
840
|
+
renderInterfaces(type.interfaces),
|
841
|
+
renderFields(type.fields)
|
842
|
+
);
|
843
|
+
}
|
844
|
+
}]);
|
845
|
+
|
846
|
+
return ObjectDocsView;
|
847
|
+
}(_react2.default.Component);
|
848
|
+
|
849
|
+
ObjectDocsView.defaultProps = {
|
850
|
+
titleOverride: null
|
851
|
+
};
|
852
|
+
|
853
|
+
var InterfaceDocsView = exports.InterfaceDocsView = function (_React$Component2) {
|
854
|
+
_inherits(InterfaceDocsView, _React$Component2);
|
855
|
+
|
856
|
+
function InterfaceDocsView() {
|
857
|
+
_classCallCheck(this, InterfaceDocsView);
|
858
|
+
|
859
|
+
return _possibleConstructorReturn(this, (InterfaceDocsView.__proto__ || Object.getPrototypeOf(InterfaceDocsView)).apply(this, arguments));
|
860
|
+
}
|
861
|
+
|
862
|
+
_createClass(InterfaceDocsView, [{
|
863
|
+
key: 'render',
|
864
|
+
value: function render() {
|
865
|
+
var type = this.props.type;
|
866
|
+
return _react2.default.createElement(
|
867
|
+
'div',
|
868
|
+
{ className: StyleSheet.type },
|
869
|
+
renderTitle(type.name),
|
870
|
+
renderDescription(type.description),
|
871
|
+
renderImplementors(type.possibleTypes),
|
872
|
+
renderFields(type.fields)
|
873
|
+
);
|
874
|
+
}
|
875
|
+
}]);
|
876
|
+
|
877
|
+
return InterfaceDocsView;
|
878
|
+
}(_react2.default.Component);
|
879
|
+
|
880
|
+
var EnumDocsView = exports.EnumDocsView = function (_React$Component3) {
|
881
|
+
_inherits(EnumDocsView, _React$Component3);
|
882
|
+
|
883
|
+
function EnumDocsView() {
|
884
|
+
_classCallCheck(this, EnumDocsView);
|
885
|
+
|
886
|
+
return _possibleConstructorReturn(this, (EnumDocsView.__proto__ || Object.getPrototypeOf(EnumDocsView)).apply(this, arguments));
|
887
|
+
}
|
888
|
+
|
889
|
+
_createClass(EnumDocsView, [{
|
890
|
+
key: 'render',
|
891
|
+
value: function render() {
|
892
|
+
var type = this.props.type;
|
893
|
+
return _react2.default.createElement(
|
894
|
+
'div',
|
895
|
+
{ className: StyleSheet.type },
|
896
|
+
renderTitle(type.name),
|
897
|
+
renderDescription(type.description),
|
898
|
+
renderEnumValues(type.enumValues)
|
899
|
+
);
|
900
|
+
}
|
901
|
+
}]);
|
902
|
+
|
903
|
+
return EnumDocsView;
|
904
|
+
}(_react2.default.Component);
|
905
|
+
|
906
|
+
var ScalarDocsView = exports.ScalarDocsView = function (_React$Component4) {
|
907
|
+
_inherits(ScalarDocsView, _React$Component4);
|
908
|
+
|
909
|
+
function ScalarDocsView() {
|
910
|
+
_classCallCheck(this, ScalarDocsView);
|
911
|
+
|
912
|
+
return _possibleConstructorReturn(this, (ScalarDocsView.__proto__ || Object.getPrototypeOf(ScalarDocsView)).apply(this, arguments));
|
913
|
+
}
|
914
|
+
|
915
|
+
_createClass(ScalarDocsView, [{
|
916
|
+
key: 'render',
|
917
|
+
value: function render() {
|
918
|
+
var type = this.props.type;
|
919
|
+
return _react2.default.createElement(
|
920
|
+
'div',
|
921
|
+
{ className: StyleSheet.type },
|
922
|
+
renderTitle(type.name),
|
923
|
+
renderDescription(type.description)
|
924
|
+
);
|
925
|
+
}
|
926
|
+
}]);
|
927
|
+
|
928
|
+
return ScalarDocsView;
|
929
|
+
}(_react2.default.Component);
|
930
|
+
|
931
|
+
var InputObjectDocsView = exports.InputObjectDocsView = function (_React$Component5) {
|
932
|
+
_inherits(InputObjectDocsView, _React$Component5);
|
933
|
+
|
934
|
+
function InputObjectDocsView() {
|
935
|
+
_classCallCheck(this, InputObjectDocsView);
|
936
|
+
|
937
|
+
return _possibleConstructorReturn(this, (InputObjectDocsView.__proto__ || Object.getPrototypeOf(InputObjectDocsView)).apply(this, arguments));
|
938
|
+
}
|
939
|
+
|
940
|
+
_createClass(InputObjectDocsView, [{
|
941
|
+
key: 'render',
|
942
|
+
value: function render() {
|
943
|
+
var type = this.props.type;
|
944
|
+
|
945
|
+
return _react2.default.createElement(
|
946
|
+
'div',
|
947
|
+
{ className: StyleSheet.type },
|
948
|
+
renderTitle(type.name),
|
949
|
+
renderDescription(type.description),
|
950
|
+
_react2.default.createElement(_FieldArgumentsTableView.FieldArgumentsTableView, {
|
951
|
+
args: type.inputFields
|
952
|
+
})
|
953
|
+
);
|
954
|
+
}
|
955
|
+
}]);
|
956
|
+
|
957
|
+
return InputObjectDocsView;
|
958
|
+
}(_react2.default.Component);
|
959
|
+
|
960
|
+
function renderTitle(typeName) {
|
961
|
+
var titleOverride = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1];
|
962
|
+
|
963
|
+
return _react2.default.createElement(
|
964
|
+
'h2',
|
965
|
+
{ className: StyleSheet.heading },
|
966
|
+
_react2.default.createElement('a', { name: typeName }),
|
967
|
+
titleOverride || typeName
|
968
|
+
);
|
969
|
+
}
|
970
|
+
|
971
|
+
function renderDescription(description) {
|
972
|
+
if (!description) {
|
973
|
+
return null;
|
974
|
+
}
|
975
|
+
|
976
|
+
return _react2.default.createElement(
|
977
|
+
'div',
|
978
|
+
null,
|
979
|
+
_react2.default.createElement(_DescriptionView.DescriptionView, { description: description })
|
980
|
+
);
|
981
|
+
}
|
982
|
+
|
983
|
+
function renderFields(fields) {
|
984
|
+
return _react2.default.createElement(
|
985
|
+
'div',
|
986
|
+
null,
|
987
|
+
_react2.default.createElement(
|
988
|
+
'div',
|
989
|
+
{ className: StyleSheet.subHeading },
|
990
|
+
'Fields'
|
991
|
+
),
|
992
|
+
fields.map(function (f) {
|
993
|
+
return _react2.default.createElement(_FieldView.FieldView, { key: f.name, field: f });
|
994
|
+
})
|
995
|
+
);
|
996
|
+
}
|
997
|
+
|
998
|
+
function renderInterfaces(interfaces) {
|
999
|
+
if (!interfaces.length) {
|
1000
|
+
return null;
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
return _react2.default.createElement(
|
1004
|
+
'div',
|
1005
|
+
null,
|
1006
|
+
_react2.default.createElement(
|
1007
|
+
'div',
|
1008
|
+
{ className: StyleSheet.subHeading },
|
1009
|
+
'Implements'
|
1010
|
+
),
|
1011
|
+
_react2.default.createElement(
|
1012
|
+
'ul',
|
1013
|
+
{ className: StyleSheet.interfacesList },
|
1014
|
+
interfaces.map(function (r, i) {
|
1015
|
+
return _react2.default.createElement(
|
1016
|
+
'li',
|
1017
|
+
{ key: i },
|
1018
|
+
_react2.default.createElement(_TypeRefView.TypeRefView, { key: i, typeRef: r })
|
1019
|
+
);
|
1020
|
+
})
|
1021
|
+
)
|
1022
|
+
);
|
1023
|
+
}
|
1024
|
+
|
1025
|
+
function renderImplementors(possibleTypes) {
|
1026
|
+
if (!possibleTypes.length) {
|
1027
|
+
return null;
|
1028
|
+
}
|
1029
|
+
|
1030
|
+
return _react2.default.createElement(
|
1031
|
+
'div',
|
1032
|
+
null,
|
1033
|
+
_react2.default.createElement(
|
1034
|
+
'div',
|
1035
|
+
{ className: StyleSheet.subHeading },
|
1036
|
+
'Implemented by'
|
1037
|
+
),
|
1038
|
+
_react2.default.createElement(
|
1039
|
+
'ul',
|
1040
|
+
{ className: StyleSheet.interfacesList },
|
1041
|
+
possibleTypes.map(function (r, i) {
|
1042
|
+
return _react2.default.createElement(
|
1043
|
+
'li',
|
1044
|
+
{ key: i },
|
1045
|
+
_react2.default.createElement(_TypeRefView.TypeRefView, { key: i, typeRef: r })
|
1046
|
+
);
|
1047
|
+
})
|
1048
|
+
)
|
1049
|
+
);
|
1050
|
+
}
|
1051
|
+
|
1052
|
+
function renderEnumValues(enumValues) {
|
1053
|
+
if (!enumValues.length) {
|
1054
|
+
return null;
|
1055
|
+
}
|
1056
|
+
|
1057
|
+
return _react2.default.createElement(
|
1058
|
+
'div',
|
1059
|
+
null,
|
1060
|
+
_react2.default.createElement(
|
1061
|
+
'div',
|
1062
|
+
{ className: StyleSheet.subHeading },
|
1063
|
+
'Possible Enum Values'
|
1064
|
+
),
|
1065
|
+
_react2.default.createElement(
|
1066
|
+
'table',
|
1067
|
+
null,
|
1068
|
+
_react2.default.createElement(
|
1069
|
+
'tbody',
|
1070
|
+
null,
|
1071
|
+
enumValues.map(function (v) {
|
1072
|
+
return _react2.default.createElement(
|
1073
|
+
'tr',
|
1074
|
+
{
|
1075
|
+
key: v.name,
|
1076
|
+
className: StyleSheet.enumRow
|
1077
|
+
},
|
1078
|
+
_react2.default.createElement(
|
1079
|
+
'td',
|
1080
|
+
{
|
1081
|
+
className: StyleSheet.enumName
|
1082
|
+
},
|
1083
|
+
v.name
|
1084
|
+
),
|
1085
|
+
_react2.default.createElement(
|
1086
|
+
'td',
|
1087
|
+
null,
|
1088
|
+
v.description && _react2.default.createElement(_DescriptionView.DescriptionView, { description: v.description })
|
1089
|
+
)
|
1090
|
+
);
|
1091
|
+
})
|
1092
|
+
)
|
1093
|
+
)
|
1094
|
+
);
|
1095
|
+
}
|
1096
|
+
|
1097
|
+
/***/ },
|
1098
|
+
/* 6 */
|
1099
|
+
/***/ function(module, exports, __webpack_require__) {
|
1100
|
+
|
1101
|
+
'use strict';
|
1102
|
+
|
1103
|
+
Object.defineProperty(exports, "__esModule", {
|
1104
|
+
value: true
|
1105
|
+
});
|
1106
|
+
exports.DescriptionView = undefined;
|
1107
|
+
|
1108
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
1109
|
+
|
1110
|
+
var _react = __webpack_require__(1);
|
1111
|
+
|
1112
|
+
var _react2 = _interopRequireDefault(_react);
|
1113
|
+
|
1114
|
+
var _marked = __webpack_require__(7);
|
1115
|
+
|
1116
|
+
var _marked2 = _interopRequireDefault(_marked);
|
1117
|
+
|
1118
|
+
var _DescriptionView = __webpack_require__(8);
|
1119
|
+
|
1120
|
+
var StyleSheet = _interopRequireWildcard(_DescriptionView);
|
1121
|
+
|
1122
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
1123
|
+
|
1124
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
1125
|
+
|
1126
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
1127
|
+
|
1128
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
1129
|
+
|
1130
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
1131
|
+
|
1132
|
+
var DescriptionView = exports.DescriptionView = function (_React$Component) {
|
1133
|
+
_inherits(DescriptionView, _React$Component);
|
1134
|
+
|
1135
|
+
function DescriptionView() {
|
1136
|
+
_classCallCheck(this, DescriptionView);
|
1137
|
+
|
1138
|
+
return _possibleConstructorReturn(this, (DescriptionView.__proto__ || Object.getPrototypeOf(DescriptionView)).apply(this, arguments));
|
1139
|
+
}
|
1140
|
+
|
1141
|
+
_createClass(DescriptionView, [{
|
1142
|
+
key: 'render',
|
1143
|
+
value: function render() {
|
1144
|
+
var html = (0, _marked2.default)(this.props.description);
|
1145
|
+
|
1146
|
+
return _react2.default.createElement('div', {
|
1147
|
+
className: [StyleSheet.container, this.props.className].join(' '),
|
1148
|
+
dangerouslySetInnerHTML: { __html: html }
|
1149
|
+
});
|
1150
|
+
}
|
1151
|
+
}]);
|
1152
|
+
|
1153
|
+
return DescriptionView;
|
1154
|
+
}(_react2.default.Component);
|
1155
|
+
|
1156
|
+
DescriptionView.defaultProps = {
|
1157
|
+
className: ''
|
1158
|
+
};
|
1159
|
+
|
1160
|
+
/***/ },
|
1161
|
+
/* 7 */
|
1162
|
+
/***/ function(module, exports, __webpack_require__) {
|
1163
|
+
|
1164
|
+
/* WEBPACK VAR INJECTION */(function(global) {/**
|
1165
|
+
* marked - a markdown parser
|
1166
|
+
* Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
|
1167
|
+
* https://github.com/chjj/marked
|
1168
|
+
*/
|
1169
|
+
|
1170
|
+
;(function() {
|
1171
|
+
|
1172
|
+
/**
|
1173
|
+
* Block-Level Grammar
|
1174
|
+
*/
|
1175
|
+
|
1176
|
+
var block = {
|
1177
|
+
newline: /^\n+/,
|
1178
|
+
code: /^( {4}[^\n]+\n*)+/,
|
1179
|
+
fences: noop,
|
1180
|
+
hr: /^( *[-*_]){3,} *(?:\n+|$)/,
|
1181
|
+
heading: /^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,
|
1182
|
+
nptable: noop,
|
1183
|
+
lheading: /^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,
|
1184
|
+
blockquote: /^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,
|
1185
|
+
list: /^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,
|
1186
|
+
html: /^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,
|
1187
|
+
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,
|
1188
|
+
table: noop,
|
1189
|
+
paragraph: /^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,
|
1190
|
+
text: /^[^\n]+/
|
1191
|
+
};
|
1192
|
+
|
1193
|
+
block.bullet = /(?:[*+-]|\d+\.)/;
|
1194
|
+
block.item = /^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;
|
1195
|
+
block.item = replace(block.item, 'gm')
|
1196
|
+
(/bull/g, block.bullet)
|
1197
|
+
();
|
1198
|
+
|
1199
|
+
block.list = replace(block.list)
|
1200
|
+
(/bull/g, block.bullet)
|
1201
|
+
('hr', '\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))')
|
1202
|
+
('def', '\\n+(?=' + block.def.source + ')')
|
1203
|
+
();
|
1204
|
+
|
1205
|
+
block.blockquote = replace(block.blockquote)
|
1206
|
+
('def', block.def)
|
1207
|
+
();
|
1208
|
+
|
1209
|
+
block._tag = '(?!(?:'
|
1210
|
+
+ 'a|em|strong|small|s|cite|q|dfn|abbr|data|time|code'
|
1211
|
+
+ '|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo'
|
1212
|
+
+ '|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b';
|
1213
|
+
|
1214
|
+
block.html = replace(block.html)
|
1215
|
+
('comment', /<!--[\s\S]*?-->/)
|
1216
|
+
('closed', /<(tag)[\s\S]+?<\/\1>/)
|
1217
|
+
('closing', /<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)
|
1218
|
+
(/tag/g, block._tag)
|
1219
|
+
();
|
1220
|
+
|
1221
|
+
block.paragraph = replace(block.paragraph)
|
1222
|
+
('hr', block.hr)
|
1223
|
+
('heading', block.heading)
|
1224
|
+
('lheading', block.lheading)
|
1225
|
+
('blockquote', block.blockquote)
|
1226
|
+
('tag', '<' + block._tag)
|
1227
|
+
('def', block.def)
|
1228
|
+
();
|
1229
|
+
|
1230
|
+
/**
|
1231
|
+
* Normal Block Grammar
|
1232
|
+
*/
|
1233
|
+
|
1234
|
+
block.normal = merge({}, block);
|
1235
|
+
|
1236
|
+
/**
|
1237
|
+
* GFM Block Grammar
|
1238
|
+
*/
|
1239
|
+
|
1240
|
+
block.gfm = merge({}, block.normal, {
|
1241
|
+
fences: /^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,
|
1242
|
+
paragraph: /^/,
|
1243
|
+
heading: /^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/
|
1244
|
+
});
|
1245
|
+
|
1246
|
+
block.gfm.paragraph = replace(block.paragraph)
|
1247
|
+
('(?!', '(?!'
|
1248
|
+
+ block.gfm.fences.source.replace('\\1', '\\2') + '|'
|
1249
|
+
+ block.list.source.replace('\\1', '\\3') + '|')
|
1250
|
+
();
|
1251
|
+
|
1252
|
+
/**
|
1253
|
+
* GFM + Tables Block Grammar
|
1254
|
+
*/
|
1255
|
+
|
1256
|
+
block.tables = merge({}, block.gfm, {
|
1257
|
+
nptable: /^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,
|
1258
|
+
table: /^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/
|
1259
|
+
});
|
1260
|
+
|
1261
|
+
/**
|
1262
|
+
* Block Lexer
|
1263
|
+
*/
|
1264
|
+
|
1265
|
+
function Lexer(options) {
|
1266
|
+
this.tokens = [];
|
1267
|
+
this.tokens.links = {};
|
1268
|
+
this.options = options || marked.defaults;
|
1269
|
+
this.rules = block.normal;
|
1270
|
+
|
1271
|
+
if (this.options.gfm) {
|
1272
|
+
if (this.options.tables) {
|
1273
|
+
this.rules = block.tables;
|
1274
|
+
} else {
|
1275
|
+
this.rules = block.gfm;
|
1276
|
+
}
|
1277
|
+
}
|
1278
|
+
}
|
1279
|
+
|
1280
|
+
/**
|
1281
|
+
* Expose Block Rules
|
1282
|
+
*/
|
1283
|
+
|
1284
|
+
Lexer.rules = block;
|
1285
|
+
|
1286
|
+
/**
|
1287
|
+
* Static Lex Method
|
1288
|
+
*/
|
1289
|
+
|
1290
|
+
Lexer.lex = function(src, options) {
|
1291
|
+
var lexer = new Lexer(options);
|
1292
|
+
return lexer.lex(src);
|
1293
|
+
};
|
1294
|
+
|
1295
|
+
/**
|
1296
|
+
* Preprocessing
|
1297
|
+
*/
|
1298
|
+
|
1299
|
+
Lexer.prototype.lex = function(src) {
|
1300
|
+
src = src
|
1301
|
+
.replace(/\r\n|\r/g, '\n')
|
1302
|
+
.replace(/\t/g, ' ')
|
1303
|
+
.replace(/\u00a0/g, ' ')
|
1304
|
+
.replace(/\u2424/g, '\n');
|
1305
|
+
|
1306
|
+
return this.token(src, true);
|
1307
|
+
};
|
1308
|
+
|
1309
|
+
/**
|
1310
|
+
* Lexing
|
1311
|
+
*/
|
1312
|
+
|
1313
|
+
Lexer.prototype.token = function(src, top, bq) {
|
1314
|
+
var src = src.replace(/^ +$/gm, '')
|
1315
|
+
, next
|
1316
|
+
, loose
|
1317
|
+
, cap
|
1318
|
+
, bull
|
1319
|
+
, b
|
1320
|
+
, item
|
1321
|
+
, space
|
1322
|
+
, i
|
1323
|
+
, l;
|
1324
|
+
|
1325
|
+
while (src) {
|
1326
|
+
// newline
|
1327
|
+
if (cap = this.rules.newline.exec(src)) {
|
1328
|
+
src = src.substring(cap[0].length);
|
1329
|
+
if (cap[0].length > 1) {
|
1330
|
+
this.tokens.push({
|
1331
|
+
type: 'space'
|
1332
|
+
});
|
1333
|
+
}
|
1334
|
+
}
|
1335
|
+
|
1336
|
+
// code
|
1337
|
+
if (cap = this.rules.code.exec(src)) {
|
1338
|
+
src = src.substring(cap[0].length);
|
1339
|
+
cap = cap[0].replace(/^ {4}/gm, '');
|
1340
|
+
this.tokens.push({
|
1341
|
+
type: 'code',
|
1342
|
+
text: !this.options.pedantic
|
1343
|
+
? cap.replace(/\n+$/, '')
|
1344
|
+
: cap
|
1345
|
+
});
|
1346
|
+
continue;
|
1347
|
+
}
|
1348
|
+
|
1349
|
+
// fences (gfm)
|
1350
|
+
if (cap = this.rules.fences.exec(src)) {
|
1351
|
+
src = src.substring(cap[0].length);
|
1352
|
+
this.tokens.push({
|
1353
|
+
type: 'code',
|
1354
|
+
lang: cap[2],
|
1355
|
+
text: cap[3] || ''
|
1356
|
+
});
|
1357
|
+
continue;
|
1358
|
+
}
|
1359
|
+
|
1360
|
+
// heading
|
1361
|
+
if (cap = this.rules.heading.exec(src)) {
|
1362
|
+
src = src.substring(cap[0].length);
|
1363
|
+
this.tokens.push({
|
1364
|
+
type: 'heading',
|
1365
|
+
depth: cap[1].length,
|
1366
|
+
text: cap[2]
|
1367
|
+
});
|
1368
|
+
continue;
|
1369
|
+
}
|
1370
|
+
|
1371
|
+
// table no leading pipe (gfm)
|
1372
|
+
if (top && (cap = this.rules.nptable.exec(src))) {
|
1373
|
+
src = src.substring(cap[0].length);
|
1374
|
+
|
1375
|
+
item = {
|
1376
|
+
type: 'table',
|
1377
|
+
header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
|
1378
|
+
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
|
1379
|
+
cells: cap[3].replace(/\n$/, '').split('\n')
|
1380
|
+
};
|
1381
|
+
|
1382
|
+
for (i = 0; i < item.align.length; i++) {
|
1383
|
+
if (/^ *-+: *$/.test(item.align[i])) {
|
1384
|
+
item.align[i] = 'right';
|
1385
|
+
} else if (/^ *:-+: *$/.test(item.align[i])) {
|
1386
|
+
item.align[i] = 'center';
|
1387
|
+
} else if (/^ *:-+ *$/.test(item.align[i])) {
|
1388
|
+
item.align[i] = 'left';
|
1389
|
+
} else {
|
1390
|
+
item.align[i] = null;
|
1391
|
+
}
|
1392
|
+
}
|
1393
|
+
|
1394
|
+
for (i = 0; i < item.cells.length; i++) {
|
1395
|
+
item.cells[i] = item.cells[i].split(/ *\| */);
|
1396
|
+
}
|
1397
|
+
|
1398
|
+
this.tokens.push(item);
|
1399
|
+
|
1400
|
+
continue;
|
1401
|
+
}
|
1402
|
+
|
1403
|
+
// lheading
|
1404
|
+
if (cap = this.rules.lheading.exec(src)) {
|
1405
|
+
src = src.substring(cap[0].length);
|
1406
|
+
this.tokens.push({
|
1407
|
+
type: 'heading',
|
1408
|
+
depth: cap[2] === '=' ? 1 : 2,
|
1409
|
+
text: cap[1]
|
1410
|
+
});
|
1411
|
+
continue;
|
1412
|
+
}
|
1413
|
+
|
1414
|
+
// hr
|
1415
|
+
if (cap = this.rules.hr.exec(src)) {
|
1416
|
+
src = src.substring(cap[0].length);
|
1417
|
+
this.tokens.push({
|
1418
|
+
type: 'hr'
|
1419
|
+
});
|
1420
|
+
continue;
|
1421
|
+
}
|
1422
|
+
|
1423
|
+
// blockquote
|
1424
|
+
if (cap = this.rules.blockquote.exec(src)) {
|
1425
|
+
src = src.substring(cap[0].length);
|
1426
|
+
|
1427
|
+
this.tokens.push({
|
1428
|
+
type: 'blockquote_start'
|
1429
|
+
});
|
1430
|
+
|
1431
|
+
cap = cap[0].replace(/^ *> ?/gm, '');
|
1432
|
+
|
1433
|
+
// Pass `top` to keep the current
|
1434
|
+
// "toplevel" state. This is exactly
|
1435
|
+
// how markdown.pl works.
|
1436
|
+
this.token(cap, top, true);
|
1437
|
+
|
1438
|
+
this.tokens.push({
|
1439
|
+
type: 'blockquote_end'
|
1440
|
+
});
|
1441
|
+
|
1442
|
+
continue;
|
1443
|
+
}
|
1444
|
+
|
1445
|
+
// list
|
1446
|
+
if (cap = this.rules.list.exec(src)) {
|
1447
|
+
src = src.substring(cap[0].length);
|
1448
|
+
bull = cap[2];
|
1449
|
+
|
1450
|
+
this.tokens.push({
|
1451
|
+
type: 'list_start',
|
1452
|
+
ordered: bull.length > 1
|
1453
|
+
});
|
1454
|
+
|
1455
|
+
// Get each top-level item.
|
1456
|
+
cap = cap[0].match(this.rules.item);
|
1457
|
+
|
1458
|
+
next = false;
|
1459
|
+
l = cap.length;
|
1460
|
+
i = 0;
|
1461
|
+
|
1462
|
+
for (; i < l; i++) {
|
1463
|
+
item = cap[i];
|
1464
|
+
|
1465
|
+
// Remove the list item's bullet
|
1466
|
+
// so it is seen as the next token.
|
1467
|
+
space = item.length;
|
1468
|
+
item = item.replace(/^ *([*+-]|\d+\.) +/, '');
|
1469
|
+
|
1470
|
+
// Outdent whatever the
|
1471
|
+
// list item contains. Hacky.
|
1472
|
+
if (~item.indexOf('\n ')) {
|
1473
|
+
space -= item.length;
|
1474
|
+
item = !this.options.pedantic
|
1475
|
+
? item.replace(new RegExp('^ {1,' + space + '}', 'gm'), '')
|
1476
|
+
: item.replace(/^ {1,4}/gm, '');
|
1477
|
+
}
|
1478
|
+
|
1479
|
+
// Determine whether the next list item belongs here.
|
1480
|
+
// Backpedal if it does not belong in this list.
|
1481
|
+
if (this.options.smartLists && i !== l - 1) {
|
1482
|
+
b = block.bullet.exec(cap[i + 1])[0];
|
1483
|
+
if (bull !== b && !(bull.length > 1 && b.length > 1)) {
|
1484
|
+
src = cap.slice(i + 1).join('\n') + src;
|
1485
|
+
i = l - 1;
|
1486
|
+
}
|
1487
|
+
}
|
1488
|
+
|
1489
|
+
// Determine whether item is loose or not.
|
1490
|
+
// Use: /(^|\n)(?! )[^\n]+\n\n(?!\s*$)/
|
1491
|
+
// for discount behavior.
|
1492
|
+
loose = next || /\n\n(?!\s*$)/.test(item);
|
1493
|
+
if (i !== l - 1) {
|
1494
|
+
next = item.charAt(item.length - 1) === '\n';
|
1495
|
+
if (!loose) loose = next;
|
1496
|
+
}
|
1497
|
+
|
1498
|
+
this.tokens.push({
|
1499
|
+
type: loose
|
1500
|
+
? 'loose_item_start'
|
1501
|
+
: 'list_item_start'
|
1502
|
+
});
|
1503
|
+
|
1504
|
+
// Recurse.
|
1505
|
+
this.token(item, false, bq);
|
1506
|
+
|
1507
|
+
this.tokens.push({
|
1508
|
+
type: 'list_item_end'
|
1509
|
+
});
|
1510
|
+
}
|
1511
|
+
|
1512
|
+
this.tokens.push({
|
1513
|
+
type: 'list_end'
|
1514
|
+
});
|
1515
|
+
|
1516
|
+
continue;
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
// html
|
1520
|
+
if (cap = this.rules.html.exec(src)) {
|
1521
|
+
src = src.substring(cap[0].length);
|
1522
|
+
this.tokens.push({
|
1523
|
+
type: this.options.sanitize
|
1524
|
+
? 'paragraph'
|
1525
|
+
: 'html',
|
1526
|
+
pre: !this.options.sanitizer
|
1527
|
+
&& (cap[1] === 'pre' || cap[1] === 'script' || cap[1] === 'style'),
|
1528
|
+
text: cap[0]
|
1529
|
+
});
|
1530
|
+
continue;
|
1531
|
+
}
|
1532
|
+
|
1533
|
+
// def
|
1534
|
+
if ((!bq && top) && (cap = this.rules.def.exec(src))) {
|
1535
|
+
src = src.substring(cap[0].length);
|
1536
|
+
this.tokens.links[cap[1].toLowerCase()] = {
|
1537
|
+
href: cap[2],
|
1538
|
+
title: cap[3]
|
1539
|
+
};
|
1540
|
+
continue;
|
1541
|
+
}
|
1542
|
+
|
1543
|
+
// table (gfm)
|
1544
|
+
if (top && (cap = this.rules.table.exec(src))) {
|
1545
|
+
src = src.substring(cap[0].length);
|
1546
|
+
|
1547
|
+
item = {
|
1548
|
+
type: 'table',
|
1549
|
+
header: cap[1].replace(/^ *| *\| *$/g, '').split(/ *\| */),
|
1550
|
+
align: cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
|
1551
|
+
cells: cap[3].replace(/(?: *\| *)?\n$/, '').split('\n')
|
1552
|
+
};
|
1553
|
+
|
1554
|
+
for (i = 0; i < item.align.length; i++) {
|
1555
|
+
if (/^ *-+: *$/.test(item.align[i])) {
|
1556
|
+
item.align[i] = 'right';
|
1557
|
+
} else if (/^ *:-+: *$/.test(item.align[i])) {
|
1558
|
+
item.align[i] = 'center';
|
1559
|
+
} else if (/^ *:-+ *$/.test(item.align[i])) {
|
1560
|
+
item.align[i] = 'left';
|
1561
|
+
} else {
|
1562
|
+
item.align[i] = null;
|
1563
|
+
}
|
1564
|
+
}
|
1565
|
+
|
1566
|
+
for (i = 0; i < item.cells.length; i++) {
|
1567
|
+
item.cells[i] = item.cells[i]
|
1568
|
+
.replace(/^ *\| *| *\| *$/g, '')
|
1569
|
+
.split(/ *\| */);
|
1570
|
+
}
|
1571
|
+
|
1572
|
+
this.tokens.push(item);
|
1573
|
+
|
1574
|
+
continue;
|
1575
|
+
}
|
1576
|
+
|
1577
|
+
// top-level paragraph
|
1578
|
+
if (top && (cap = this.rules.paragraph.exec(src))) {
|
1579
|
+
src = src.substring(cap[0].length);
|
1580
|
+
this.tokens.push({
|
1581
|
+
type: 'paragraph',
|
1582
|
+
text: cap[1].charAt(cap[1].length - 1) === '\n'
|
1583
|
+
? cap[1].slice(0, -1)
|
1584
|
+
: cap[1]
|
1585
|
+
});
|
1586
|
+
continue;
|
1587
|
+
}
|
1588
|
+
|
1589
|
+
// text
|
1590
|
+
if (cap = this.rules.text.exec(src)) {
|
1591
|
+
// Top-level should never reach here.
|
1592
|
+
src = src.substring(cap[0].length);
|
1593
|
+
this.tokens.push({
|
1594
|
+
type: 'text',
|
1595
|
+
text: cap[0]
|
1596
|
+
});
|
1597
|
+
continue;
|
1598
|
+
}
|
1599
|
+
|
1600
|
+
if (src) {
|
1601
|
+
throw new
|
1602
|
+
Error('Infinite loop on byte: ' + src.charCodeAt(0));
|
1603
|
+
}
|
1604
|
+
}
|
1605
|
+
|
1606
|
+
return this.tokens;
|
1607
|
+
};
|
1608
|
+
|
1609
|
+
/**
|
1610
|
+
* Inline-Level Grammar
|
1611
|
+
*/
|
1612
|
+
|
1613
|
+
var inline = {
|
1614
|
+
escape: /^\\([\\`*{}\[\]()#+\-.!_>])/,
|
1615
|
+
autolink: /^<([^ >]+(@|:\/)[^ >]+)>/,
|
1616
|
+
url: noop,
|
1617
|
+
tag: /^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,
|
1618
|
+
link: /^!?\[(inside)\]\(href\)/,
|
1619
|
+
reflink: /^!?\[(inside)\]\s*\[([^\]]*)\]/,
|
1620
|
+
nolink: /^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,
|
1621
|
+
strong: /^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,
|
1622
|
+
em: /^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,
|
1623
|
+
code: /^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,
|
1624
|
+
br: /^ {2,}\n(?!\s*$)/,
|
1625
|
+
del: noop,
|
1626
|
+
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
|
1627
|
+
};
|
1628
|
+
|
1629
|
+
inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
|
1630
|
+
inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
|
1631
|
+
|
1632
|
+
inline.link = replace(inline.link)
|
1633
|
+
('inside', inline._inside)
|
1634
|
+
('href', inline._href)
|
1635
|
+
();
|
1636
|
+
|
1637
|
+
inline.reflink = replace(inline.reflink)
|
1638
|
+
('inside', inline._inside)
|
1639
|
+
();
|
1640
|
+
|
1641
|
+
/**
|
1642
|
+
* Normal Inline Grammar
|
1643
|
+
*/
|
1644
|
+
|
1645
|
+
inline.normal = merge({}, inline);
|
1646
|
+
|
1647
|
+
/**
|
1648
|
+
* Pedantic Inline Grammar
|
1649
|
+
*/
|
1650
|
+
|
1651
|
+
inline.pedantic = merge({}, inline.normal, {
|
1652
|
+
strong: /^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,
|
1653
|
+
em: /^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/
|
1654
|
+
});
|
1655
|
+
|
1656
|
+
/**
|
1657
|
+
* GFM Inline Grammar
|
1658
|
+
*/
|
1659
|
+
|
1660
|
+
inline.gfm = merge({}, inline.normal, {
|
1661
|
+
escape: replace(inline.escape)('])', '~|])')(),
|
1662
|
+
url: /^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,
|
1663
|
+
del: /^~~(?=\S)([\s\S]*?\S)~~/,
|
1664
|
+
text: replace(inline.text)
|
1665
|
+
(']|', '~]|')
|
1666
|
+
('|', '|https?://|')
|
1667
|
+
()
|
1668
|
+
});
|
1669
|
+
|
1670
|
+
/**
|
1671
|
+
* GFM + Line Breaks Inline Grammar
|
1672
|
+
*/
|
1673
|
+
|
1674
|
+
inline.breaks = merge({}, inline.gfm, {
|
1675
|
+
br: replace(inline.br)('{2,}', '*')(),
|
1676
|
+
text: replace(inline.gfm.text)('{2,}', '*')()
|
1677
|
+
});
|
1678
|
+
|
1679
|
+
/**
|
1680
|
+
* Inline Lexer & Compiler
|
1681
|
+
*/
|
1682
|
+
|
1683
|
+
function InlineLexer(links, options) {
|
1684
|
+
this.options = options || marked.defaults;
|
1685
|
+
this.links = links;
|
1686
|
+
this.rules = inline.normal;
|
1687
|
+
this.renderer = this.options.renderer || new Renderer;
|
1688
|
+
this.renderer.options = this.options;
|
1689
|
+
|
1690
|
+
if (!this.links) {
|
1691
|
+
throw new
|
1692
|
+
Error('Tokens array requires a `links` property.');
|
1693
|
+
}
|
1694
|
+
|
1695
|
+
if (this.options.gfm) {
|
1696
|
+
if (this.options.breaks) {
|
1697
|
+
this.rules = inline.breaks;
|
1698
|
+
} else {
|
1699
|
+
this.rules = inline.gfm;
|
1700
|
+
}
|
1701
|
+
} else if (this.options.pedantic) {
|
1702
|
+
this.rules = inline.pedantic;
|
1703
|
+
}
|
1704
|
+
}
|
1705
|
+
|
1706
|
+
/**
|
1707
|
+
* Expose Inline Rules
|
1708
|
+
*/
|
1709
|
+
|
1710
|
+
InlineLexer.rules = inline;
|
1711
|
+
|
1712
|
+
/**
|
1713
|
+
* Static Lexing/Compiling Method
|
1714
|
+
*/
|
1715
|
+
|
1716
|
+
InlineLexer.output = function(src, links, options) {
|
1717
|
+
var inline = new InlineLexer(links, options);
|
1718
|
+
return inline.output(src);
|
1719
|
+
};
|
1720
|
+
|
1721
|
+
/**
|
1722
|
+
* Lexing/Compiling
|
1723
|
+
*/
|
1724
|
+
|
1725
|
+
InlineLexer.prototype.output = function(src) {
|
1726
|
+
var out = ''
|
1727
|
+
, link
|
1728
|
+
, text
|
1729
|
+
, href
|
1730
|
+
, cap;
|
1731
|
+
|
1732
|
+
while (src) {
|
1733
|
+
// escape
|
1734
|
+
if (cap = this.rules.escape.exec(src)) {
|
1735
|
+
src = src.substring(cap[0].length);
|
1736
|
+
out += cap[1];
|
1737
|
+
continue;
|
1738
|
+
}
|
1739
|
+
|
1740
|
+
// autolink
|
1741
|
+
if (cap = this.rules.autolink.exec(src)) {
|
1742
|
+
src = src.substring(cap[0].length);
|
1743
|
+
if (cap[2] === '@') {
|
1744
|
+
text = cap[1].charAt(6) === ':'
|
1745
|
+
? this.mangle(cap[1].substring(7))
|
1746
|
+
: this.mangle(cap[1]);
|
1747
|
+
href = this.mangle('mailto:') + text;
|
1748
|
+
} else {
|
1749
|
+
text = escape(cap[1]);
|
1750
|
+
href = text;
|
1751
|
+
}
|
1752
|
+
out += this.renderer.link(href, null, text);
|
1753
|
+
continue;
|
1754
|
+
}
|
1755
|
+
|
1756
|
+
// url (gfm)
|
1757
|
+
if (!this.inLink && (cap = this.rules.url.exec(src))) {
|
1758
|
+
src = src.substring(cap[0].length);
|
1759
|
+
text = escape(cap[1]);
|
1760
|
+
href = text;
|
1761
|
+
out += this.renderer.link(href, null, text);
|
1762
|
+
continue;
|
1763
|
+
}
|
1764
|
+
|
1765
|
+
// tag
|
1766
|
+
if (cap = this.rules.tag.exec(src)) {
|
1767
|
+
if (!this.inLink && /^<a /i.test(cap[0])) {
|
1768
|
+
this.inLink = true;
|
1769
|
+
} else if (this.inLink && /^<\/a>/i.test(cap[0])) {
|
1770
|
+
this.inLink = false;
|
1771
|
+
}
|
1772
|
+
src = src.substring(cap[0].length);
|
1773
|
+
out += this.options.sanitize
|
1774
|
+
? this.options.sanitizer
|
1775
|
+
? this.options.sanitizer(cap[0])
|
1776
|
+
: escape(cap[0])
|
1777
|
+
: cap[0]
|
1778
|
+
continue;
|
1779
|
+
}
|
1780
|
+
|
1781
|
+
// link
|
1782
|
+
if (cap = this.rules.link.exec(src)) {
|
1783
|
+
src = src.substring(cap[0].length);
|
1784
|
+
this.inLink = true;
|
1785
|
+
out += this.outputLink(cap, {
|
1786
|
+
href: cap[2],
|
1787
|
+
title: cap[3]
|
1788
|
+
});
|
1789
|
+
this.inLink = false;
|
1790
|
+
continue;
|
1791
|
+
}
|
1792
|
+
|
1793
|
+
// reflink, nolink
|
1794
|
+
if ((cap = this.rules.reflink.exec(src))
|
1795
|
+
|| (cap = this.rules.nolink.exec(src))) {
|
1796
|
+
src = src.substring(cap[0].length);
|
1797
|
+
link = (cap[2] || cap[1]).replace(/\s+/g, ' ');
|
1798
|
+
link = this.links[link.toLowerCase()];
|
1799
|
+
if (!link || !link.href) {
|
1800
|
+
out += cap[0].charAt(0);
|
1801
|
+
src = cap[0].substring(1) + src;
|
1802
|
+
continue;
|
1803
|
+
}
|
1804
|
+
this.inLink = true;
|
1805
|
+
out += this.outputLink(cap, link);
|
1806
|
+
this.inLink = false;
|
1807
|
+
continue;
|
1808
|
+
}
|
1809
|
+
|
1810
|
+
// strong
|
1811
|
+
if (cap = this.rules.strong.exec(src)) {
|
1812
|
+
src = src.substring(cap[0].length);
|
1813
|
+
out += this.renderer.strong(this.output(cap[2] || cap[1]));
|
1814
|
+
continue;
|
1815
|
+
}
|
1816
|
+
|
1817
|
+
// em
|
1818
|
+
if (cap = this.rules.em.exec(src)) {
|
1819
|
+
src = src.substring(cap[0].length);
|
1820
|
+
out += this.renderer.em(this.output(cap[2] || cap[1]));
|
1821
|
+
continue;
|
1822
|
+
}
|
1823
|
+
|
1824
|
+
// code
|
1825
|
+
if (cap = this.rules.code.exec(src)) {
|
1826
|
+
src = src.substring(cap[0].length);
|
1827
|
+
out += this.renderer.codespan(escape(cap[2], true));
|
1828
|
+
continue;
|
1829
|
+
}
|
1830
|
+
|
1831
|
+
// br
|
1832
|
+
if (cap = this.rules.br.exec(src)) {
|
1833
|
+
src = src.substring(cap[0].length);
|
1834
|
+
out += this.renderer.br();
|
1835
|
+
continue;
|
1836
|
+
}
|
1837
|
+
|
1838
|
+
// del (gfm)
|
1839
|
+
if (cap = this.rules.del.exec(src)) {
|
1840
|
+
src = src.substring(cap[0].length);
|
1841
|
+
out += this.renderer.del(this.output(cap[1]));
|
1842
|
+
continue;
|
1843
|
+
}
|
1844
|
+
|
1845
|
+
// text
|
1846
|
+
if (cap = this.rules.text.exec(src)) {
|
1847
|
+
src = src.substring(cap[0].length);
|
1848
|
+
out += this.renderer.text(escape(this.smartypants(cap[0])));
|
1849
|
+
continue;
|
1850
|
+
}
|
1851
|
+
|
1852
|
+
if (src) {
|
1853
|
+
throw new
|
1854
|
+
Error('Infinite loop on byte: ' + src.charCodeAt(0));
|
1855
|
+
}
|
1856
|
+
}
|
1857
|
+
|
1858
|
+
return out;
|
1859
|
+
};
|
1860
|
+
|
1861
|
+
/**
|
1862
|
+
* Compile Link
|
1863
|
+
*/
|
1864
|
+
|
1865
|
+
InlineLexer.prototype.outputLink = function(cap, link) {
|
1866
|
+
var href = escape(link.href)
|
1867
|
+
, title = link.title ? escape(link.title) : null;
|
1868
|
+
|
1869
|
+
return cap[0].charAt(0) !== '!'
|
1870
|
+
? this.renderer.link(href, title, this.output(cap[1]))
|
1871
|
+
: this.renderer.image(href, title, escape(cap[1]));
|
1872
|
+
};
|
1873
|
+
|
1874
|
+
/**
|
1875
|
+
* Smartypants Transformations
|
1876
|
+
*/
|
1877
|
+
|
1878
|
+
InlineLexer.prototype.smartypants = function(text) {
|
1879
|
+
if (!this.options.smartypants) return text;
|
1880
|
+
return text
|
1881
|
+
// em-dashes
|
1882
|
+
.replace(/---/g, '\u2014')
|
1883
|
+
// en-dashes
|
1884
|
+
.replace(/--/g, '\u2013')
|
1885
|
+
// opening singles
|
1886
|
+
.replace(/(^|[-\u2014/(\[{"\s])'/g, '$1\u2018')
|
1887
|
+
// closing singles & apostrophes
|
1888
|
+
.replace(/'/g, '\u2019')
|
1889
|
+
// opening doubles
|
1890
|
+
.replace(/(^|[-\u2014/(\[{\u2018\s])"/g, '$1\u201c')
|
1891
|
+
// closing doubles
|
1892
|
+
.replace(/"/g, '\u201d')
|
1893
|
+
// ellipses
|
1894
|
+
.replace(/\.{3}/g, '\u2026');
|
1895
|
+
};
|
1896
|
+
|
1897
|
+
/**
|
1898
|
+
* Mangle Links
|
1899
|
+
*/
|
1900
|
+
|
1901
|
+
InlineLexer.prototype.mangle = function(text) {
|
1902
|
+
if (!this.options.mangle) return text;
|
1903
|
+
var out = ''
|
1904
|
+
, l = text.length
|
1905
|
+
, i = 0
|
1906
|
+
, ch;
|
1907
|
+
|
1908
|
+
for (; i < l; i++) {
|
1909
|
+
ch = text.charCodeAt(i);
|
1910
|
+
if (Math.random() > 0.5) {
|
1911
|
+
ch = 'x' + ch.toString(16);
|
1912
|
+
}
|
1913
|
+
out += '&#' + ch + ';';
|
1914
|
+
}
|
1915
|
+
|
1916
|
+
return out;
|
1917
|
+
};
|
1918
|
+
|
1919
|
+
/**
|
1920
|
+
* Renderer
|
1921
|
+
*/
|
1922
|
+
|
1923
|
+
function Renderer(options) {
|
1924
|
+
this.options = options || {};
|
1925
|
+
}
|
1926
|
+
|
1927
|
+
Renderer.prototype.code = function(code, lang, escaped) {
|
1928
|
+
if (this.options.highlight) {
|
1929
|
+
var out = this.options.highlight(code, lang);
|
1930
|
+
if (out != null && out !== code) {
|
1931
|
+
escaped = true;
|
1932
|
+
code = out;
|
1933
|
+
}
|
1934
|
+
}
|
1935
|
+
|
1936
|
+
if (!lang) {
|
1937
|
+
return '<pre><code>'
|
1938
|
+
+ (escaped ? code : escape(code, true))
|
1939
|
+
+ '\n</code></pre>';
|
1940
|
+
}
|
1941
|
+
|
1942
|
+
return '<pre><code class="'
|
1943
|
+
+ this.options.langPrefix
|
1944
|
+
+ escape(lang, true)
|
1945
|
+
+ '">'
|
1946
|
+
+ (escaped ? code : escape(code, true))
|
1947
|
+
+ '\n</code></pre>\n';
|
1948
|
+
};
|
1949
|
+
|
1950
|
+
Renderer.prototype.blockquote = function(quote) {
|
1951
|
+
return '<blockquote>\n' + quote + '</blockquote>\n';
|
1952
|
+
};
|
1953
|
+
|
1954
|
+
Renderer.prototype.html = function(html) {
|
1955
|
+
return html;
|
1956
|
+
};
|
1957
|
+
|
1958
|
+
Renderer.prototype.heading = function(text, level, raw) {
|
1959
|
+
return '<h'
|
1960
|
+
+ level
|
1961
|
+
+ ' id="'
|
1962
|
+
+ this.options.headerPrefix
|
1963
|
+
+ raw.toLowerCase().replace(/[^\w]+/g, '-')
|
1964
|
+
+ '">'
|
1965
|
+
+ text
|
1966
|
+
+ '</h'
|
1967
|
+
+ level
|
1968
|
+
+ '>\n';
|
1969
|
+
};
|
1970
|
+
|
1971
|
+
Renderer.prototype.hr = function() {
|
1972
|
+
return this.options.xhtml ? '<hr/>\n' : '<hr>\n';
|
1973
|
+
};
|
1974
|
+
|
1975
|
+
Renderer.prototype.list = function(body, ordered) {
|
1976
|
+
var type = ordered ? 'ol' : 'ul';
|
1977
|
+
return '<' + type + '>\n' + body + '</' + type + '>\n';
|
1978
|
+
};
|
1979
|
+
|
1980
|
+
Renderer.prototype.listitem = function(text) {
|
1981
|
+
return '<li>' + text + '</li>\n';
|
1982
|
+
};
|
1983
|
+
|
1984
|
+
Renderer.prototype.paragraph = function(text) {
|
1985
|
+
return '<p>' + text + '</p>\n';
|
1986
|
+
};
|
1987
|
+
|
1988
|
+
Renderer.prototype.table = function(header, body) {
|
1989
|
+
return '<table>\n'
|
1990
|
+
+ '<thead>\n'
|
1991
|
+
+ header
|
1992
|
+
+ '</thead>\n'
|
1993
|
+
+ '<tbody>\n'
|
1994
|
+
+ body
|
1995
|
+
+ '</tbody>\n'
|
1996
|
+
+ '</table>\n';
|
1997
|
+
};
|
1998
|
+
|
1999
|
+
Renderer.prototype.tablerow = function(content) {
|
2000
|
+
return '<tr>\n' + content + '</tr>\n';
|
2001
|
+
};
|
2002
|
+
|
2003
|
+
Renderer.prototype.tablecell = function(content, flags) {
|
2004
|
+
var type = flags.header ? 'th' : 'td';
|
2005
|
+
var tag = flags.align
|
2006
|
+
? '<' + type + ' style="text-align:' + flags.align + '">'
|
2007
|
+
: '<' + type + '>';
|
2008
|
+
return tag + content + '</' + type + '>\n';
|
2009
|
+
};
|
2010
|
+
|
2011
|
+
// span level renderer
|
2012
|
+
Renderer.prototype.strong = function(text) {
|
2013
|
+
return '<strong>' + text + '</strong>';
|
2014
|
+
};
|
2015
|
+
|
2016
|
+
Renderer.prototype.em = function(text) {
|
2017
|
+
return '<em>' + text + '</em>';
|
2018
|
+
};
|
2019
|
+
|
2020
|
+
Renderer.prototype.codespan = function(text) {
|
2021
|
+
return '<code>' + text + '</code>';
|
2022
|
+
};
|
2023
|
+
|
2024
|
+
Renderer.prototype.br = function() {
|
2025
|
+
return this.options.xhtml ? '<br/>' : '<br>';
|
2026
|
+
};
|
2027
|
+
|
2028
|
+
Renderer.prototype.del = function(text) {
|
2029
|
+
return '<del>' + text + '</del>';
|
2030
|
+
};
|
2031
|
+
|
2032
|
+
Renderer.prototype.link = function(href, title, text) {
|
2033
|
+
if (this.options.sanitize) {
|
2034
|
+
try {
|
2035
|
+
var prot = decodeURIComponent(unescape(href))
|
2036
|
+
.replace(/[^\w:]/g, '')
|
2037
|
+
.toLowerCase();
|
2038
|
+
} catch (e) {
|
2039
|
+
return '';
|
2040
|
+
}
|
2041
|
+
if (prot.indexOf('javascript:') === 0 || prot.indexOf('vbscript:') === 0) {
|
2042
|
+
return '';
|
2043
|
+
}
|
2044
|
+
}
|
2045
|
+
var out = '<a href="' + href + '"';
|
2046
|
+
if (title) {
|
2047
|
+
out += ' title="' + title + '"';
|
2048
|
+
}
|
2049
|
+
out += '>' + text + '</a>';
|
2050
|
+
return out;
|
2051
|
+
};
|
2052
|
+
|
2053
|
+
Renderer.prototype.image = function(href, title, text) {
|
2054
|
+
var out = '<img src="' + href + '" alt="' + text + '"';
|
2055
|
+
if (title) {
|
2056
|
+
out += ' title="' + title + '"';
|
2057
|
+
}
|
2058
|
+
out += this.options.xhtml ? '/>' : '>';
|
2059
|
+
return out;
|
2060
|
+
};
|
2061
|
+
|
2062
|
+
Renderer.prototype.text = function(text) {
|
2063
|
+
return text;
|
2064
|
+
};
|
2065
|
+
|
2066
|
+
/**
|
2067
|
+
* Parsing & Compiling
|
2068
|
+
*/
|
2069
|
+
|
2070
|
+
function Parser(options) {
|
2071
|
+
this.tokens = [];
|
2072
|
+
this.token = null;
|
2073
|
+
this.options = options || marked.defaults;
|
2074
|
+
this.options.renderer = this.options.renderer || new Renderer;
|
2075
|
+
this.renderer = this.options.renderer;
|
2076
|
+
this.renderer.options = this.options;
|
2077
|
+
}
|
2078
|
+
|
2079
|
+
/**
|
2080
|
+
* Static Parse Method
|
2081
|
+
*/
|
2082
|
+
|
2083
|
+
Parser.parse = function(src, options, renderer) {
|
2084
|
+
var parser = new Parser(options, renderer);
|
2085
|
+
return parser.parse(src);
|
2086
|
+
};
|
2087
|
+
|
2088
|
+
/**
|
2089
|
+
* Parse Loop
|
2090
|
+
*/
|
2091
|
+
|
2092
|
+
Parser.prototype.parse = function(src) {
|
2093
|
+
this.inline = new InlineLexer(src.links, this.options, this.renderer);
|
2094
|
+
this.tokens = src.reverse();
|
2095
|
+
|
2096
|
+
var out = '';
|
2097
|
+
while (this.next()) {
|
2098
|
+
out += this.tok();
|
2099
|
+
}
|
2100
|
+
|
2101
|
+
return out;
|
2102
|
+
};
|
2103
|
+
|
2104
|
+
/**
|
2105
|
+
* Next Token
|
2106
|
+
*/
|
2107
|
+
|
2108
|
+
Parser.prototype.next = function() {
|
2109
|
+
return this.token = this.tokens.pop();
|
2110
|
+
};
|
2111
|
+
|
2112
|
+
/**
|
2113
|
+
* Preview Next Token
|
2114
|
+
*/
|
2115
|
+
|
2116
|
+
Parser.prototype.peek = function() {
|
2117
|
+
return this.tokens[this.tokens.length - 1] || 0;
|
2118
|
+
};
|
2119
|
+
|
2120
|
+
/**
|
2121
|
+
* Parse Text Tokens
|
2122
|
+
*/
|
2123
|
+
|
2124
|
+
Parser.prototype.parseText = function() {
|
2125
|
+
var body = this.token.text;
|
2126
|
+
|
2127
|
+
while (this.peek().type === 'text') {
|
2128
|
+
body += '\n' + this.next().text;
|
2129
|
+
}
|
2130
|
+
|
2131
|
+
return this.inline.output(body);
|
2132
|
+
};
|
2133
|
+
|
2134
|
+
/**
|
2135
|
+
* Parse Current Token
|
2136
|
+
*/
|
2137
|
+
|
2138
|
+
Parser.prototype.tok = function() {
|
2139
|
+
switch (this.token.type) {
|
2140
|
+
case 'space': {
|
2141
|
+
return '';
|
2142
|
+
}
|
2143
|
+
case 'hr': {
|
2144
|
+
return this.renderer.hr();
|
2145
|
+
}
|
2146
|
+
case 'heading': {
|
2147
|
+
return this.renderer.heading(
|
2148
|
+
this.inline.output(this.token.text),
|
2149
|
+
this.token.depth,
|
2150
|
+
this.token.text);
|
2151
|
+
}
|
2152
|
+
case 'code': {
|
2153
|
+
return this.renderer.code(this.token.text,
|
2154
|
+
this.token.lang,
|
2155
|
+
this.token.escaped);
|
2156
|
+
}
|
2157
|
+
case 'table': {
|
2158
|
+
var header = ''
|
2159
|
+
, body = ''
|
2160
|
+
, i
|
2161
|
+
, row
|
2162
|
+
, cell
|
2163
|
+
, flags
|
2164
|
+
, j;
|
2165
|
+
|
2166
|
+
// header
|
2167
|
+
cell = '';
|
2168
|
+
for (i = 0; i < this.token.header.length; i++) {
|
2169
|
+
flags = { header: true, align: this.token.align[i] };
|
2170
|
+
cell += this.renderer.tablecell(
|
2171
|
+
this.inline.output(this.token.header[i]),
|
2172
|
+
{ header: true, align: this.token.align[i] }
|
2173
|
+
);
|
2174
|
+
}
|
2175
|
+
header += this.renderer.tablerow(cell);
|
2176
|
+
|
2177
|
+
for (i = 0; i < this.token.cells.length; i++) {
|
2178
|
+
row = this.token.cells[i];
|
2179
|
+
|
2180
|
+
cell = '';
|
2181
|
+
for (j = 0; j < row.length; j++) {
|
2182
|
+
cell += this.renderer.tablecell(
|
2183
|
+
this.inline.output(row[j]),
|
2184
|
+
{ header: false, align: this.token.align[j] }
|
2185
|
+
);
|
2186
|
+
}
|
2187
|
+
|
2188
|
+
body += this.renderer.tablerow(cell);
|
2189
|
+
}
|
2190
|
+
return this.renderer.table(header, body);
|
2191
|
+
}
|
2192
|
+
case 'blockquote_start': {
|
2193
|
+
var body = '';
|
2194
|
+
|
2195
|
+
while (this.next().type !== 'blockquote_end') {
|
2196
|
+
body += this.tok();
|
2197
|
+
}
|
2198
|
+
|
2199
|
+
return this.renderer.blockquote(body);
|
2200
|
+
}
|
2201
|
+
case 'list_start': {
|
2202
|
+
var body = ''
|
2203
|
+
, ordered = this.token.ordered;
|
2204
|
+
|
2205
|
+
while (this.next().type !== 'list_end') {
|
2206
|
+
body += this.tok();
|
2207
|
+
}
|
2208
|
+
|
2209
|
+
return this.renderer.list(body, ordered);
|
2210
|
+
}
|
2211
|
+
case 'list_item_start': {
|
2212
|
+
var body = '';
|
2213
|
+
|
2214
|
+
while (this.next().type !== 'list_item_end') {
|
2215
|
+
body += this.token.type === 'text'
|
2216
|
+
? this.parseText()
|
2217
|
+
: this.tok();
|
2218
|
+
}
|
2219
|
+
|
2220
|
+
return this.renderer.listitem(body);
|
2221
|
+
}
|
2222
|
+
case 'loose_item_start': {
|
2223
|
+
var body = '';
|
2224
|
+
|
2225
|
+
while (this.next().type !== 'list_item_end') {
|
2226
|
+
body += this.tok();
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
return this.renderer.listitem(body);
|
2230
|
+
}
|
2231
|
+
case 'html': {
|
2232
|
+
var html = !this.token.pre && !this.options.pedantic
|
2233
|
+
? this.inline.output(this.token.text)
|
2234
|
+
: this.token.text;
|
2235
|
+
return this.renderer.html(html);
|
2236
|
+
}
|
2237
|
+
case 'paragraph': {
|
2238
|
+
return this.renderer.paragraph(this.inline.output(this.token.text));
|
2239
|
+
}
|
2240
|
+
case 'text': {
|
2241
|
+
return this.renderer.paragraph(this.parseText());
|
2242
|
+
}
|
2243
|
+
}
|
2244
|
+
};
|
2245
|
+
|
2246
|
+
/**
|
2247
|
+
* Helpers
|
2248
|
+
*/
|
2249
|
+
|
2250
|
+
function escape(html, encode) {
|
2251
|
+
return html
|
2252
|
+
.replace(!encode ? /&(?!#?\w+;)/g : /&/g, '&')
|
2253
|
+
.replace(/</g, '<')
|
2254
|
+
.replace(/>/g, '>')
|
2255
|
+
.replace(/"/g, '"')
|
2256
|
+
.replace(/'/g, ''');
|
2257
|
+
}
|
2258
|
+
|
2259
|
+
function unescape(html) {
|
2260
|
+
// explicitly match decimal, hex, and named HTML entities
|
2261
|
+
return html.replace(/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/g, function(_, n) {
|
2262
|
+
n = n.toLowerCase();
|
2263
|
+
if (n === 'colon') return ':';
|
2264
|
+
if (n.charAt(0) === '#') {
|
2265
|
+
return n.charAt(1) === 'x'
|
2266
|
+
? String.fromCharCode(parseInt(n.substring(2), 16))
|
2267
|
+
: String.fromCharCode(+n.substring(1));
|
2268
|
+
}
|
2269
|
+
return '';
|
2270
|
+
});
|
2271
|
+
}
|
2272
|
+
|
2273
|
+
function replace(regex, opt) {
|
2274
|
+
regex = regex.source;
|
2275
|
+
opt = opt || '';
|
2276
|
+
return function self(name, val) {
|
2277
|
+
if (!name) return new RegExp(regex, opt);
|
2278
|
+
val = val.source || val;
|
2279
|
+
val = val.replace(/(^|[^\[])\^/g, '$1');
|
2280
|
+
regex = regex.replace(name, val);
|
2281
|
+
return self;
|
2282
|
+
};
|
2283
|
+
}
|
2284
|
+
|
2285
|
+
function noop() {}
|
2286
|
+
noop.exec = noop;
|
2287
|
+
|
2288
|
+
function merge(obj) {
|
2289
|
+
var i = 1
|
2290
|
+
, target
|
2291
|
+
, key;
|
2292
|
+
|
2293
|
+
for (; i < arguments.length; i++) {
|
2294
|
+
target = arguments[i];
|
2295
|
+
for (key in target) {
|
2296
|
+
if (Object.prototype.hasOwnProperty.call(target, key)) {
|
2297
|
+
obj[key] = target[key];
|
2298
|
+
}
|
2299
|
+
}
|
2300
|
+
}
|
2301
|
+
|
2302
|
+
return obj;
|
2303
|
+
}
|
2304
|
+
|
2305
|
+
|
2306
|
+
/**
|
2307
|
+
* Marked
|
2308
|
+
*/
|
2309
|
+
|
2310
|
+
function marked(src, opt, callback) {
|
2311
|
+
if (callback || typeof opt === 'function') {
|
2312
|
+
if (!callback) {
|
2313
|
+
callback = opt;
|
2314
|
+
opt = null;
|
2315
|
+
}
|
2316
|
+
|
2317
|
+
opt = merge({}, marked.defaults, opt || {});
|
2318
|
+
|
2319
|
+
var highlight = opt.highlight
|
2320
|
+
, tokens
|
2321
|
+
, pending
|
2322
|
+
, i = 0;
|
2323
|
+
|
2324
|
+
try {
|
2325
|
+
tokens = Lexer.lex(src, opt)
|
2326
|
+
} catch (e) {
|
2327
|
+
return callback(e);
|
2328
|
+
}
|
2329
|
+
|
2330
|
+
pending = tokens.length;
|
2331
|
+
|
2332
|
+
var done = function(err) {
|
2333
|
+
if (err) {
|
2334
|
+
opt.highlight = highlight;
|
2335
|
+
return callback(err);
|
2336
|
+
}
|
2337
|
+
|
2338
|
+
var out;
|
2339
|
+
|
2340
|
+
try {
|
2341
|
+
out = Parser.parse(tokens, opt);
|
2342
|
+
} catch (e) {
|
2343
|
+
err = e;
|
2344
|
+
}
|
2345
|
+
|
2346
|
+
opt.highlight = highlight;
|
2347
|
+
|
2348
|
+
return err
|
2349
|
+
? callback(err)
|
2350
|
+
: callback(null, out);
|
2351
|
+
};
|
2352
|
+
|
2353
|
+
if (!highlight || highlight.length < 3) {
|
2354
|
+
return done();
|
2355
|
+
}
|
2356
|
+
|
2357
|
+
delete opt.highlight;
|
2358
|
+
|
2359
|
+
if (!pending) return done();
|
2360
|
+
|
2361
|
+
for (; i < tokens.length; i++) {
|
2362
|
+
(function(token) {
|
2363
|
+
if (token.type !== 'code') {
|
2364
|
+
return --pending || done();
|
2365
|
+
}
|
2366
|
+
return highlight(token.text, token.lang, function(err, code) {
|
2367
|
+
if (err) return done(err);
|
2368
|
+
if (code == null || code === token.text) {
|
2369
|
+
return --pending || done();
|
2370
|
+
}
|
2371
|
+
token.text = code;
|
2372
|
+
token.escaped = true;
|
2373
|
+
--pending || done();
|
2374
|
+
});
|
2375
|
+
})(tokens[i]);
|
2376
|
+
}
|
2377
|
+
|
2378
|
+
return;
|
2379
|
+
}
|
2380
|
+
try {
|
2381
|
+
if (opt) opt = merge({}, marked.defaults, opt);
|
2382
|
+
return Parser.parse(Lexer.lex(src, opt), opt);
|
2383
|
+
} catch (e) {
|
2384
|
+
e.message += '\nPlease report this to https://github.com/chjj/marked.';
|
2385
|
+
if ((opt || marked.defaults).silent) {
|
2386
|
+
return '<p>An error occured:</p><pre>'
|
2387
|
+
+ escape(e.message + '', true)
|
2388
|
+
+ '</pre>';
|
2389
|
+
}
|
2390
|
+
throw e;
|
2391
|
+
}
|
2392
|
+
}
|
2393
|
+
|
2394
|
+
/**
|
2395
|
+
* Options
|
2396
|
+
*/
|
2397
|
+
|
2398
|
+
marked.options =
|
2399
|
+
marked.setOptions = function(opt) {
|
2400
|
+
merge(marked.defaults, opt);
|
2401
|
+
return marked;
|
2402
|
+
};
|
2403
|
+
|
2404
|
+
marked.defaults = {
|
2405
|
+
gfm: true,
|
2406
|
+
tables: true,
|
2407
|
+
breaks: false,
|
2408
|
+
pedantic: false,
|
2409
|
+
sanitize: false,
|
2410
|
+
sanitizer: null,
|
2411
|
+
mangle: true,
|
2412
|
+
smartLists: false,
|
2413
|
+
silent: false,
|
2414
|
+
highlight: null,
|
2415
|
+
langPrefix: 'lang-',
|
2416
|
+
smartypants: false,
|
2417
|
+
headerPrefix: '',
|
2418
|
+
renderer: new Renderer,
|
2419
|
+
xhtml: false
|
2420
|
+
};
|
2421
|
+
|
2422
|
+
/**
|
2423
|
+
* Expose
|
2424
|
+
*/
|
2425
|
+
|
2426
|
+
marked.Parser = Parser;
|
2427
|
+
marked.parser = Parser.parse;
|
2428
|
+
|
2429
|
+
marked.Renderer = Renderer;
|
2430
|
+
|
2431
|
+
marked.Lexer = Lexer;
|
2432
|
+
marked.lexer = Lexer.lex;
|
2433
|
+
|
2434
|
+
marked.InlineLexer = InlineLexer;
|
2435
|
+
marked.inlineLexer = InlineLexer.output;
|
2436
|
+
|
2437
|
+
marked.parse = marked;
|
2438
|
+
|
2439
|
+
if (true) {
|
2440
|
+
module.exports = marked;
|
2441
|
+
} else if (typeof define === 'function' && define.amd) {
|
2442
|
+
define(function() { return marked; });
|
2443
|
+
} else {
|
2444
|
+
this.marked = marked;
|
2445
|
+
}
|
2446
|
+
|
2447
|
+
}).call(function() {
|
2448
|
+
return this || (typeof window !== 'undefined' ? window : global);
|
2449
|
+
}());
|
2450
|
+
|
2451
|
+
/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
|
2452
|
+
|
2453
|
+
/***/ },
|
2454
|
+
/* 8 */
|
2455
|
+
/***/ function(module, exports, __webpack_require__) {
|
2456
|
+
|
2457
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
2458
|
+
|
2459
|
+
// load the styles
|
2460
|
+
var content = __webpack_require__(9);
|
2461
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
2462
|
+
// add the styles to the DOM
|
2463
|
+
var update = __webpack_require__(11)(content, {});
|
2464
|
+
if(content.locals) module.exports = content.locals;
|
2465
|
+
// Hot Module Replacement
|
2466
|
+
if(false) {
|
2467
|
+
// When the styles change, update the <style> tags
|
2468
|
+
if(!content.locals) {
|
2469
|
+
module.hot.accept("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./DescriptionView.css", function() {
|
2470
|
+
var newContent = require("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./DescriptionView.css");
|
2471
|
+
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
2472
|
+
update(newContent);
|
2473
|
+
});
|
2474
|
+
}
|
2475
|
+
// When the module is disposed, remove the <style> tags
|
2476
|
+
module.hot.dispose(function() { update(); });
|
2477
|
+
}
|
2478
|
+
|
2479
|
+
/***/ },
|
2480
|
+
/* 9 */
|
2481
|
+
/***/ function(module, exports, __webpack_require__) {
|
2482
|
+
|
2483
|
+
exports = module.exports = __webpack_require__(10)();
|
2484
|
+
// imports
|
2485
|
+
|
2486
|
+
|
2487
|
+
// module
|
2488
|
+
exports.push([module.id, "._1S63EXzJ2LWrq2TSLX8cAu :first-child {\n margin-top: 0;\n}\n\n._1S63EXzJ2LWrq2TSLX8cAu :last-child {\n margin-bottom: 0;\n}\n\n._1S63EXzJ2LWrq2TSLX8cAu h1 {\n font-size: 1.3em;\n}\n\n._1S63EXzJ2LWrq2TSLX8cAu h2 {\n font-size: 1.1em;\n}\n\n._1S63EXzJ2LWrq2TSLX8cAu h3 {\n font-size: 1em;\n -webkit-font-feature-settings: \"c2sc\";\n font-feature-settings: \"c2sc\";\n font-variant: small-caps;\n}\n\n._1S63EXzJ2LWrq2TSLX8cAu blockquote {\n border-left: 8px solid #e8e8e8;\n margin-top: -0.3em;\n padding-top: 0.3em;\n margin-left: 20px;\n padding-left: 12px;\n margin-bottom: -0.5em;\n padding-bottom: 0.5em;\n}\n", ""]);
|
2489
|
+
|
2490
|
+
// exports
|
2491
|
+
exports.locals = {
|
2492
|
+
"container": "_1S63EXzJ2LWrq2TSLX8cAu"
|
2493
|
+
};
|
2494
|
+
|
2495
|
+
/***/ },
|
2496
|
+
/* 10 */
|
2497
|
+
/***/ function(module, exports) {
|
2498
|
+
|
2499
|
+
/*
|
2500
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
2501
|
+
Author Tobias Koppers @sokra
|
2502
|
+
*/
|
2503
|
+
// css base code, injected by the css-loader
|
2504
|
+
module.exports = function() {
|
2505
|
+
var list = [];
|
2506
|
+
|
2507
|
+
// return the list of modules as css string
|
2508
|
+
list.toString = function toString() {
|
2509
|
+
var result = [];
|
2510
|
+
for(var i = 0; i < this.length; i++) {
|
2511
|
+
var item = this[i];
|
2512
|
+
if(item[2]) {
|
2513
|
+
result.push("@media " + item[2] + "{" + item[1] + "}");
|
2514
|
+
} else {
|
2515
|
+
result.push(item[1]);
|
2516
|
+
}
|
2517
|
+
}
|
2518
|
+
return result.join("");
|
2519
|
+
};
|
2520
|
+
|
2521
|
+
// import a list of modules into the list
|
2522
|
+
list.i = function(modules, mediaQuery) {
|
2523
|
+
if(typeof modules === "string")
|
2524
|
+
modules = [[null, modules, ""]];
|
2525
|
+
var alreadyImportedModules = {};
|
2526
|
+
for(var i = 0; i < this.length; i++) {
|
2527
|
+
var id = this[i][0];
|
2528
|
+
if(typeof id === "number")
|
2529
|
+
alreadyImportedModules[id] = true;
|
2530
|
+
}
|
2531
|
+
for(i = 0; i < modules.length; i++) {
|
2532
|
+
var item = modules[i];
|
2533
|
+
// skip already imported module
|
2534
|
+
// this implementation is not 100% perfect for weird media query combinations
|
2535
|
+
// when a module is imported multiple times with different media queries.
|
2536
|
+
// I hope this will never occur (Hey this way we have smaller bundles)
|
2537
|
+
if(typeof item[0] !== "number" || !alreadyImportedModules[item[0]]) {
|
2538
|
+
if(mediaQuery && !item[2]) {
|
2539
|
+
item[2] = mediaQuery;
|
2540
|
+
} else if(mediaQuery) {
|
2541
|
+
item[2] = "(" + item[2] + ") and (" + mediaQuery + ")";
|
2542
|
+
}
|
2543
|
+
list.push(item);
|
2544
|
+
}
|
2545
|
+
}
|
2546
|
+
};
|
2547
|
+
return list;
|
2548
|
+
};
|
2549
|
+
|
2550
|
+
|
2551
|
+
/***/ },
|
2552
|
+
/* 11 */
|
2553
|
+
/***/ function(module, exports, __webpack_require__) {
|
2554
|
+
|
2555
|
+
/*
|
2556
|
+
MIT License http://www.opensource.org/licenses/mit-license.php
|
2557
|
+
Author Tobias Koppers @sokra
|
2558
|
+
*/
|
2559
|
+
var stylesInDom = {},
|
2560
|
+
memoize = function(fn) {
|
2561
|
+
var memo;
|
2562
|
+
return function () {
|
2563
|
+
if (typeof memo === "undefined") memo = fn.apply(this, arguments);
|
2564
|
+
return memo;
|
2565
|
+
};
|
2566
|
+
},
|
2567
|
+
isOldIE = memoize(function() {
|
2568
|
+
return /msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase());
|
2569
|
+
}),
|
2570
|
+
getHeadElement = memoize(function () {
|
2571
|
+
return document.head || document.getElementsByTagName("head")[0];
|
2572
|
+
}),
|
2573
|
+
singletonElement = null,
|
2574
|
+
singletonCounter = 0,
|
2575
|
+
styleElementsInsertedAtTop = [];
|
2576
|
+
|
2577
|
+
module.exports = function(list, options) {
|
2578
|
+
if(false) {
|
2579
|
+
if(typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
|
2580
|
+
}
|
2581
|
+
|
2582
|
+
options = options || {};
|
2583
|
+
// Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
|
2584
|
+
// tags it will allow on a page
|
2585
|
+
if (typeof options.singleton === "undefined") options.singleton = isOldIE();
|
2586
|
+
|
2587
|
+
// By default, add <style> tags to the bottom of <head>.
|
2588
|
+
if (typeof options.insertAt === "undefined") options.insertAt = "bottom";
|
2589
|
+
|
2590
|
+
var styles = listToStyles(list);
|
2591
|
+
addStylesToDom(styles, options);
|
2592
|
+
|
2593
|
+
return function update(newList) {
|
2594
|
+
var mayRemove = [];
|
2595
|
+
for(var i = 0; i < styles.length; i++) {
|
2596
|
+
var item = styles[i];
|
2597
|
+
var domStyle = stylesInDom[item.id];
|
2598
|
+
domStyle.refs--;
|
2599
|
+
mayRemove.push(domStyle);
|
2600
|
+
}
|
2601
|
+
if(newList) {
|
2602
|
+
var newStyles = listToStyles(newList);
|
2603
|
+
addStylesToDom(newStyles, options);
|
2604
|
+
}
|
2605
|
+
for(var i = 0; i < mayRemove.length; i++) {
|
2606
|
+
var domStyle = mayRemove[i];
|
2607
|
+
if(domStyle.refs === 0) {
|
2608
|
+
for(var j = 0; j < domStyle.parts.length; j++)
|
2609
|
+
domStyle.parts[j]();
|
2610
|
+
delete stylesInDom[domStyle.id];
|
2611
|
+
}
|
2612
|
+
}
|
2613
|
+
};
|
2614
|
+
}
|
2615
|
+
|
2616
|
+
function addStylesToDom(styles, options) {
|
2617
|
+
for(var i = 0; i < styles.length; i++) {
|
2618
|
+
var item = styles[i];
|
2619
|
+
var domStyle = stylesInDom[item.id];
|
2620
|
+
if(domStyle) {
|
2621
|
+
domStyle.refs++;
|
2622
|
+
for(var j = 0; j < domStyle.parts.length; j++) {
|
2623
|
+
domStyle.parts[j](item.parts[j]);
|
2624
|
+
}
|
2625
|
+
for(; j < item.parts.length; j++) {
|
2626
|
+
domStyle.parts.push(addStyle(item.parts[j], options));
|
2627
|
+
}
|
2628
|
+
} else {
|
2629
|
+
var parts = [];
|
2630
|
+
for(var j = 0; j < item.parts.length; j++) {
|
2631
|
+
parts.push(addStyle(item.parts[j], options));
|
2632
|
+
}
|
2633
|
+
stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
|
2634
|
+
}
|
2635
|
+
}
|
2636
|
+
}
|
2637
|
+
|
2638
|
+
function listToStyles(list) {
|
2639
|
+
var styles = [];
|
2640
|
+
var newStyles = {};
|
2641
|
+
for(var i = 0; i < list.length; i++) {
|
2642
|
+
var item = list[i];
|
2643
|
+
var id = item[0];
|
2644
|
+
var css = item[1];
|
2645
|
+
var media = item[2];
|
2646
|
+
var sourceMap = item[3];
|
2647
|
+
var part = {css: css, media: media, sourceMap: sourceMap};
|
2648
|
+
if(!newStyles[id])
|
2649
|
+
styles.push(newStyles[id] = {id: id, parts: [part]});
|
2650
|
+
else
|
2651
|
+
newStyles[id].parts.push(part);
|
2652
|
+
}
|
2653
|
+
return styles;
|
2654
|
+
}
|
2655
|
+
|
2656
|
+
function insertStyleElement(options, styleElement) {
|
2657
|
+
var head = getHeadElement();
|
2658
|
+
var lastStyleElementInsertedAtTop = styleElementsInsertedAtTop[styleElementsInsertedAtTop.length - 1];
|
2659
|
+
if (options.insertAt === "top") {
|
2660
|
+
if(!lastStyleElementInsertedAtTop) {
|
2661
|
+
head.insertBefore(styleElement, head.firstChild);
|
2662
|
+
} else if(lastStyleElementInsertedAtTop.nextSibling) {
|
2663
|
+
head.insertBefore(styleElement, lastStyleElementInsertedAtTop.nextSibling);
|
2664
|
+
} else {
|
2665
|
+
head.appendChild(styleElement);
|
2666
|
+
}
|
2667
|
+
styleElementsInsertedAtTop.push(styleElement);
|
2668
|
+
} else if (options.insertAt === "bottom") {
|
2669
|
+
head.appendChild(styleElement);
|
2670
|
+
} else {
|
2671
|
+
throw new Error("Invalid value for parameter 'insertAt'. Must be 'top' or 'bottom'.");
|
2672
|
+
}
|
2673
|
+
}
|
2674
|
+
|
2675
|
+
function removeStyleElement(styleElement) {
|
2676
|
+
styleElement.parentNode.removeChild(styleElement);
|
2677
|
+
var idx = styleElementsInsertedAtTop.indexOf(styleElement);
|
2678
|
+
if(idx >= 0) {
|
2679
|
+
styleElementsInsertedAtTop.splice(idx, 1);
|
2680
|
+
}
|
2681
|
+
}
|
2682
|
+
|
2683
|
+
function createStyleElement(options) {
|
2684
|
+
var styleElement = document.createElement("style");
|
2685
|
+
styleElement.type = "text/css";
|
2686
|
+
insertStyleElement(options, styleElement);
|
2687
|
+
return styleElement;
|
2688
|
+
}
|
2689
|
+
|
2690
|
+
function createLinkElement(options) {
|
2691
|
+
var linkElement = document.createElement("link");
|
2692
|
+
linkElement.rel = "stylesheet";
|
2693
|
+
insertStyleElement(options, linkElement);
|
2694
|
+
return linkElement;
|
2695
|
+
}
|
2696
|
+
|
2697
|
+
function addStyle(obj, options) {
|
2698
|
+
var styleElement, update, remove;
|
2699
|
+
|
2700
|
+
if (options.singleton) {
|
2701
|
+
var styleIndex = singletonCounter++;
|
2702
|
+
styleElement = singletonElement || (singletonElement = createStyleElement(options));
|
2703
|
+
update = applyToSingletonTag.bind(null, styleElement, styleIndex, false);
|
2704
|
+
remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true);
|
2705
|
+
} else if(obj.sourceMap &&
|
2706
|
+
typeof URL === "function" &&
|
2707
|
+
typeof URL.createObjectURL === "function" &&
|
2708
|
+
typeof URL.revokeObjectURL === "function" &&
|
2709
|
+
typeof Blob === "function" &&
|
2710
|
+
typeof btoa === "function") {
|
2711
|
+
styleElement = createLinkElement(options);
|
2712
|
+
update = updateLink.bind(null, styleElement);
|
2713
|
+
remove = function() {
|
2714
|
+
removeStyleElement(styleElement);
|
2715
|
+
if(styleElement.href)
|
2716
|
+
URL.revokeObjectURL(styleElement.href);
|
2717
|
+
};
|
2718
|
+
} else {
|
2719
|
+
styleElement = createStyleElement(options);
|
2720
|
+
update = applyToTag.bind(null, styleElement);
|
2721
|
+
remove = function() {
|
2722
|
+
removeStyleElement(styleElement);
|
2723
|
+
};
|
2724
|
+
}
|
2725
|
+
|
2726
|
+
update(obj);
|
2727
|
+
|
2728
|
+
return function updateStyle(newObj) {
|
2729
|
+
if(newObj) {
|
2730
|
+
if(newObj.css === obj.css && newObj.media === obj.media && newObj.sourceMap === obj.sourceMap)
|
2731
|
+
return;
|
2732
|
+
update(obj = newObj);
|
2733
|
+
} else {
|
2734
|
+
remove();
|
2735
|
+
}
|
2736
|
+
};
|
2737
|
+
}
|
2738
|
+
|
2739
|
+
var replaceText = (function () {
|
2740
|
+
var textStore = [];
|
2741
|
+
|
2742
|
+
return function (index, replacement) {
|
2743
|
+
textStore[index] = replacement;
|
2744
|
+
return textStore.filter(Boolean).join('\n');
|
2745
|
+
};
|
2746
|
+
})();
|
2747
|
+
|
2748
|
+
function applyToSingletonTag(styleElement, index, remove, obj) {
|
2749
|
+
var css = remove ? "" : obj.css;
|
2750
|
+
|
2751
|
+
if (styleElement.styleSheet) {
|
2752
|
+
styleElement.styleSheet.cssText = replaceText(index, css);
|
2753
|
+
} else {
|
2754
|
+
var cssNode = document.createTextNode(css);
|
2755
|
+
var childNodes = styleElement.childNodes;
|
2756
|
+
if (childNodes[index]) styleElement.removeChild(childNodes[index]);
|
2757
|
+
if (childNodes.length) {
|
2758
|
+
styleElement.insertBefore(cssNode, childNodes[index]);
|
2759
|
+
} else {
|
2760
|
+
styleElement.appendChild(cssNode);
|
2761
|
+
}
|
2762
|
+
}
|
2763
|
+
}
|
2764
|
+
|
2765
|
+
function applyToTag(styleElement, obj) {
|
2766
|
+
var css = obj.css;
|
2767
|
+
var media = obj.media;
|
2768
|
+
|
2769
|
+
if(media) {
|
2770
|
+
styleElement.setAttribute("media", media)
|
2771
|
+
}
|
2772
|
+
|
2773
|
+
if(styleElement.styleSheet) {
|
2774
|
+
styleElement.styleSheet.cssText = css;
|
2775
|
+
} else {
|
2776
|
+
while(styleElement.firstChild) {
|
2777
|
+
styleElement.removeChild(styleElement.firstChild);
|
2778
|
+
}
|
2779
|
+
styleElement.appendChild(document.createTextNode(css));
|
2780
|
+
}
|
2781
|
+
}
|
2782
|
+
|
2783
|
+
function updateLink(linkElement, obj) {
|
2784
|
+
var css = obj.css;
|
2785
|
+
var sourceMap = obj.sourceMap;
|
2786
|
+
|
2787
|
+
if(sourceMap) {
|
2788
|
+
// http://stackoverflow.com/a/26603875
|
2789
|
+
css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
|
2790
|
+
}
|
2791
|
+
|
2792
|
+
var blob = new Blob([css], { type: "text/css" });
|
2793
|
+
|
2794
|
+
var oldSrc = linkElement.href;
|
2795
|
+
|
2796
|
+
linkElement.href = URL.createObjectURL(blob);
|
2797
|
+
|
2798
|
+
if(oldSrc)
|
2799
|
+
URL.revokeObjectURL(oldSrc);
|
2800
|
+
}
|
2801
|
+
|
2802
|
+
|
2803
|
+
/***/ },
|
2804
|
+
/* 12 */
|
2805
|
+
/***/ function(module, exports, __webpack_require__) {
|
2806
|
+
|
2807
|
+
'use strict';
|
2808
|
+
|
2809
|
+
Object.defineProperty(exports, "__esModule", {
|
2810
|
+
value: true
|
2811
|
+
});
|
2812
|
+
exports.FieldView = undefined;
|
2813
|
+
|
2814
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
2815
|
+
|
2816
|
+
var _react = __webpack_require__(1);
|
2817
|
+
|
2818
|
+
var _react2 = _interopRequireDefault(_react);
|
2819
|
+
|
2820
|
+
var _model = __webpack_require__(3);
|
2821
|
+
|
2822
|
+
var _DescriptionView = __webpack_require__(6);
|
2823
|
+
|
2824
|
+
var _FieldSyntaxView = __webpack_require__(13);
|
2825
|
+
|
2826
|
+
var _FieldArgumentsTableView = __webpack_require__(20);
|
2827
|
+
|
2828
|
+
var _FieldView = __webpack_require__(23);
|
2829
|
+
|
2830
|
+
var StyleSheet = _interopRequireWildcard(_FieldView);
|
2831
|
+
|
2832
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
2833
|
+
|
2834
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2835
|
+
|
2836
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2837
|
+
|
2838
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
2839
|
+
|
2840
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
2841
|
+
|
2842
|
+
var FieldView = exports.FieldView = function (_React$Component) {
|
2843
|
+
_inherits(FieldView, _React$Component);
|
2844
|
+
|
2845
|
+
function FieldView() {
|
2846
|
+
_classCallCheck(this, FieldView);
|
2847
|
+
|
2848
|
+
return _possibleConstructorReturn(this, (FieldView.__proto__ || Object.getPrototypeOf(FieldView)).apply(this, arguments));
|
2849
|
+
}
|
2850
|
+
|
2851
|
+
_createClass(FieldView, [{
|
2852
|
+
key: 'render',
|
2853
|
+
value: function render() {
|
2854
|
+
var field = this.props.field;
|
2855
|
+
|
2856
|
+
return _react2.default.createElement(
|
2857
|
+
'div',
|
2858
|
+
{
|
2859
|
+
key: field.name,
|
2860
|
+
className: StyleSheet.container
|
2861
|
+
},
|
2862
|
+
_react2.default.createElement(_FieldSyntaxView.FieldSyntaxView, { field: field }),
|
2863
|
+
this.renderDescription(field.description),
|
2864
|
+
_react2.default.createElement(_FieldArgumentsTableView.FieldArgumentsTableView, { args: field.args })
|
2865
|
+
);
|
2866
|
+
}
|
2867
|
+
}, {
|
2868
|
+
key: 'renderDescription',
|
2869
|
+
value: function renderDescription(description) {
|
2870
|
+
if (!description) {
|
2871
|
+
return null;
|
2872
|
+
}
|
2873
|
+
|
2874
|
+
return _react2.default.createElement(_DescriptionView.DescriptionView, {
|
2875
|
+
className: StyleSheet.description,
|
2876
|
+
description: description
|
2877
|
+
});
|
2878
|
+
}
|
2879
|
+
}]);
|
2880
|
+
|
2881
|
+
return FieldView;
|
2882
|
+
}(_react2.default.Component);
|
2883
|
+
|
2884
|
+
/***/ },
|
2885
|
+
/* 13 */
|
2886
|
+
/***/ function(module, exports, __webpack_require__) {
|
2887
|
+
|
2888
|
+
'use strict';
|
2889
|
+
|
2890
|
+
Object.defineProperty(exports, "__esModule", {
|
2891
|
+
value: true
|
2892
|
+
});
|
2893
|
+
exports.FieldSyntaxView = undefined;
|
2894
|
+
|
2895
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
2896
|
+
|
2897
|
+
var _react = __webpack_require__(1);
|
2898
|
+
|
2899
|
+
var _react2 = _interopRequireDefault(_react);
|
2900
|
+
|
2901
|
+
var _model = __webpack_require__(3);
|
2902
|
+
|
2903
|
+
var _TypeRefView = __webpack_require__(14);
|
2904
|
+
|
2905
|
+
var _FieldSyntaxView = __webpack_require__(18);
|
2906
|
+
|
2907
|
+
var StyleSheet = _interopRequireWildcard(_FieldSyntaxView);
|
2908
|
+
|
2909
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
2910
|
+
|
2911
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
2912
|
+
|
2913
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
2914
|
+
|
2915
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
2916
|
+
|
2917
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
2918
|
+
|
2919
|
+
var FieldSyntaxView = exports.FieldSyntaxView = function (_React$Component) {
|
2920
|
+
_inherits(FieldSyntaxView, _React$Component);
|
2921
|
+
|
2922
|
+
function FieldSyntaxView() {
|
2923
|
+
_classCallCheck(this, FieldSyntaxView);
|
2924
|
+
|
2925
|
+
return _possibleConstructorReturn(this, (FieldSyntaxView.__proto__ || Object.getPrototypeOf(FieldSyntaxView)).apply(this, arguments));
|
2926
|
+
}
|
2927
|
+
|
2928
|
+
_createClass(FieldSyntaxView, [{
|
2929
|
+
key: 'render',
|
2930
|
+
value: function render() {
|
2931
|
+
var field = this.props.field;
|
2932
|
+
|
2933
|
+
return _react2.default.createElement(
|
2934
|
+
'div',
|
2935
|
+
{ className: StyleSheet.container },
|
2936
|
+
_react2.default.createElement(
|
2937
|
+
'span',
|
2938
|
+
{ className: StyleSheet.name },
|
2939
|
+
field.name
|
2940
|
+
),
|
2941
|
+
this.renderFieldArgs(field.args),
|
2942
|
+
': ',
|
2943
|
+
_react2.default.createElement(_TypeRefView.TypeRefView, { typeRef: field.type })
|
2944
|
+
);
|
2945
|
+
}
|
2946
|
+
}, {
|
2947
|
+
key: 'renderFieldArgs',
|
2948
|
+
value: function renderFieldArgs(args) {
|
2949
|
+
var _this2 = this;
|
2950
|
+
|
2951
|
+
if (!args.length) {
|
2952
|
+
return null;
|
2953
|
+
}
|
2954
|
+
|
2955
|
+
return _react2.default.createElement(
|
2956
|
+
'span',
|
2957
|
+
null,
|
2958
|
+
'(',
|
2959
|
+
args.map(function (arg, idx) {
|
2960
|
+
return _this2.renderField(arg, idx);
|
2961
|
+
}),
|
2962
|
+
')'
|
2963
|
+
);
|
2964
|
+
}
|
2965
|
+
}, {
|
2966
|
+
key: 'renderField',
|
2967
|
+
value: function renderField(arg, index) {
|
2968
|
+
return _react2.default.createElement(
|
2969
|
+
'span',
|
2970
|
+
{ key: arg.name },
|
2971
|
+
index > 0 ? _react2.default.createElement(
|
2972
|
+
'span',
|
2973
|
+
null,
|
2974
|
+
', '
|
2975
|
+
) : null,
|
2976
|
+
_react2.default.createElement(
|
2977
|
+
'span',
|
2978
|
+
{ className: StyleSheet.argumentName },
|
2979
|
+
arg.name
|
2980
|
+
),
|
2981
|
+
': ',
|
2982
|
+
_react2.default.createElement(_TypeRefView.TypeRefView, { typeRef: arg.type }),
|
2983
|
+
this.renderDefaultValue(arg.defaultValue)
|
2984
|
+
);
|
2985
|
+
}
|
2986
|
+
}, {
|
2987
|
+
key: 'renderDefaultValue',
|
2988
|
+
value: function renderDefaultValue(defaultValue) {
|
2989
|
+
if (!defaultValue) {
|
2990
|
+
return null;
|
2991
|
+
}
|
2992
|
+
|
2993
|
+
return _react2.default.createElement(
|
2994
|
+
'span',
|
2995
|
+
{ className: StyleSheet.defaultValue },
|
2996
|
+
' = ',
|
2997
|
+
defaultValue
|
2998
|
+
);
|
2999
|
+
}
|
3000
|
+
}]);
|
3001
|
+
|
3002
|
+
return FieldSyntaxView;
|
3003
|
+
}(_react2.default.Component);
|
3004
|
+
|
3005
|
+
/***/ },
|
3006
|
+
/* 14 */
|
3007
|
+
/***/ function(module, exports, __webpack_require__) {
|
3008
|
+
|
3009
|
+
'use strict';
|
3010
|
+
|
3011
|
+
Object.defineProperty(exports, "__esModule", {
|
3012
|
+
value: true
|
3013
|
+
});
|
3014
|
+
exports.TypeRefView = undefined;
|
3015
|
+
|
3016
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
3017
|
+
|
3018
|
+
var _react = __webpack_require__(1);
|
3019
|
+
|
3020
|
+
var _react2 = _interopRequireDefault(_react);
|
3021
|
+
|
3022
|
+
var _model = __webpack_require__(3);
|
3023
|
+
|
3024
|
+
var _TypeRefView = __webpack_require__(15);
|
3025
|
+
|
3026
|
+
var StyleSheet = _interopRequireWildcard(_TypeRefView);
|
3027
|
+
|
3028
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
3029
|
+
|
3030
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3031
|
+
|
3032
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3033
|
+
|
3034
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3035
|
+
|
3036
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
3037
|
+
|
3038
|
+
var TypeRefView = exports.TypeRefView = function (_React$Component) {
|
3039
|
+
_inherits(TypeRefView, _React$Component);
|
3040
|
+
|
3041
|
+
function TypeRefView() {
|
3042
|
+
_classCallCheck(this, TypeRefView);
|
3043
|
+
|
3044
|
+
return _possibleConstructorReturn(this, (TypeRefView.__proto__ || Object.getPrototypeOf(TypeRefView)).apply(this, arguments));
|
3045
|
+
}
|
3046
|
+
|
3047
|
+
_createClass(TypeRefView, [{
|
3048
|
+
key: 'render',
|
3049
|
+
value: function render() {
|
3050
|
+
var ref = this.props.typeRef;
|
3051
|
+
|
3052
|
+
if (ref instanceof _model.NamedTypeRef) {
|
3053
|
+
return _react2.default.createElement(
|
3054
|
+
'a',
|
3055
|
+
{
|
3056
|
+
className: StyleSheet.typeRef,
|
3057
|
+
href: '#' + ref.typeName
|
3058
|
+
},
|
3059
|
+
ref.typeName
|
3060
|
+
);
|
3061
|
+
} else if (ref instanceof _model.NonNullTypeRef) {
|
3062
|
+
return _react2.default.createElement(
|
3063
|
+
'span',
|
3064
|
+
null,
|
3065
|
+
_react2.default.createElement(TypeRefView, { typeRef: ref.ofType }),
|
3066
|
+
'!'
|
3067
|
+
);
|
3068
|
+
} else if (ref instanceof _model.ListTypeRef) {
|
3069
|
+
return _react2.default.createElement(
|
3070
|
+
'span',
|
3071
|
+
null,
|
3072
|
+
'[',
|
3073
|
+
_react2.default.createElement(TypeRefView, { typeRef: ref.ofType }),
|
3074
|
+
']'
|
3075
|
+
);
|
3076
|
+
}
|
3077
|
+
|
3078
|
+
throw new Error('Unknown type ref: ' + ref.toString());
|
3079
|
+
}
|
3080
|
+
}]);
|
3081
|
+
|
3082
|
+
return TypeRefView;
|
3083
|
+
}(_react2.default.Component);
|
3084
|
+
|
3085
|
+
/***/ },
|
3086
|
+
/* 15 */
|
3087
|
+
/***/ function(module, exports, __webpack_require__) {
|
3088
|
+
|
3089
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
3090
|
+
|
3091
|
+
// load the styles
|
3092
|
+
var content = __webpack_require__(16);
|
3093
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
3094
|
+
// add the styles to the DOM
|
3095
|
+
var update = __webpack_require__(11)(content, {});
|
3096
|
+
if(content.locals) module.exports = content.locals;
|
3097
|
+
// Hot Module Replacement
|
3098
|
+
if(false) {
|
3099
|
+
// When the styles change, update the <style> tags
|
3100
|
+
if(!content.locals) {
|
3101
|
+
module.hot.accept("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./TypeRefView.css", function() {
|
3102
|
+
var newContent = require("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./TypeRefView.css");
|
3103
|
+
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
3104
|
+
update(newContent);
|
3105
|
+
});
|
3106
|
+
}
|
3107
|
+
// When the module is disposed, remove the <style> tags
|
3108
|
+
module.hot.dispose(function() { update(); });
|
3109
|
+
}
|
3110
|
+
|
3111
|
+
/***/ },
|
3112
|
+
/* 16 */
|
3113
|
+
/***/ function(module, exports, __webpack_require__) {
|
3114
|
+
|
3115
|
+
exports = module.exports = __webpack_require__(10)();
|
3116
|
+
// imports
|
3117
|
+
exports.i(__webpack_require__(17), undefined);
|
3118
|
+
|
3119
|
+
// module
|
3120
|
+
exports.push([module.id, "._3Ue4q58Ya6q2FCTVkZKllk {\n}\n", ""]);
|
3121
|
+
|
3122
|
+
// exports
|
3123
|
+
exports.locals = {
|
3124
|
+
"typeRef": "_3Ue4q58Ya6q2FCTVkZKllk " + __webpack_require__(17).locals["typeLink"] + ""
|
3125
|
+
};
|
3126
|
+
|
3127
|
+
/***/ },
|
3128
|
+
/* 17 */
|
3129
|
+
/***/ function(module, exports, __webpack_require__) {
|
3130
|
+
|
3131
|
+
exports = module.exports = __webpack_require__(10)();
|
3132
|
+
// imports
|
3133
|
+
|
3134
|
+
|
3135
|
+
// module
|
3136
|
+
exports.push([module.id, "._3_QndMLrl0DS7txXsKk5aM {\n color: #5b2699;\n}\n\n._1QSb_Lywz03jNMCELm-GrU {\n padding-right: 16px;\n padding-right: 1rem;\n white-space: nowrap;\n}\n\n._3a5669pwdwJabgmbtJHumc {\n line-height: 1.3;\n}\n\n._3Xlbyq0Qo-JOAJLLx2z9-l {\n color: #64381f;\n}\n\n.NgU4gHjdynLJU2YSbF4ic {\n color: #836c28;\n}\n\n._15sahXcXCjIULC63jwKqZE {\n color: #007400;\n}\n\n._1ssUqN390ygEtVlxHSnU0e,\n._1ssUqN390ygEtVlxHSnU0e:active,\n._1ssUqN390ygEtVlxHSnU0e:hover,\n._1ssUqN390ygEtVlxHSnU0e:visited {\n color: #007400;\n}\n", ""]);
|
3137
|
+
|
3138
|
+
// exports
|
3139
|
+
exports.locals = {
|
3140
|
+
"argumentName": "_3_QndMLrl0DS7txXsKk5aM",
|
3141
|
+
"argumentCell": "_1QSb_Lywz03jNMCELm-GrU",
|
3142
|
+
"argumentRow": "_3a5669pwdwJabgmbtJHumc",
|
3143
|
+
"fieldName": "_3Xlbyq0Qo-JOAJLLx2z9-l",
|
3144
|
+
"defaultValue": "NgU4gHjdynLJU2YSbF4ic",
|
3145
|
+
"typeName": "_15sahXcXCjIULC63jwKqZE",
|
3146
|
+
"typeLink": "_1ssUqN390ygEtVlxHSnU0e"
|
3147
|
+
};
|
3148
|
+
|
3149
|
+
/***/ },
|
3150
|
+
/* 18 */
|
3151
|
+
/***/ function(module, exports, __webpack_require__) {
|
3152
|
+
|
3153
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
3154
|
+
|
3155
|
+
// load the styles
|
3156
|
+
var content = __webpack_require__(19);
|
3157
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
3158
|
+
// add the styles to the DOM
|
3159
|
+
var update = __webpack_require__(11)(content, {});
|
3160
|
+
if(content.locals) module.exports = content.locals;
|
3161
|
+
// Hot Module Replacement
|
3162
|
+
if(false) {
|
3163
|
+
// When the styles change, update the <style> tags
|
3164
|
+
if(!content.locals) {
|
3165
|
+
module.hot.accept("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./FieldSyntaxView.css", function() {
|
3166
|
+
var newContent = require("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./FieldSyntaxView.css");
|
3167
|
+
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
3168
|
+
update(newContent);
|
3169
|
+
});
|
3170
|
+
}
|
3171
|
+
// When the module is disposed, remove the <style> tags
|
3172
|
+
module.hot.dispose(function() { update(); });
|
3173
|
+
}
|
3174
|
+
|
3175
|
+
/***/ },
|
3176
|
+
/* 19 */
|
3177
|
+
/***/ function(module, exports, __webpack_require__) {
|
3178
|
+
|
3179
|
+
exports = module.exports = __webpack_require__(10)();
|
3180
|
+
// imports
|
3181
|
+
exports.i(__webpack_require__(17), undefined);
|
3182
|
+
|
3183
|
+
// module
|
3184
|
+
exports.push([module.id, "._3Q9rTqv61jz1TMbQgSC21Y {\n margin-bottom: 3.2px;\n margin-bottom: 0.2rem;\n}\n\n.pfwgw1KVkaL-Jspb7XsLn {\n}\n\n._3qTEJI-SGaaBwcproq96Z9 {\n}\n\n._1C3jrn92-2_teD3Q_-WwDn {\n}\n", ""]);
|
3185
|
+
|
3186
|
+
// exports
|
3187
|
+
exports.locals = {
|
3188
|
+
"container": "_3Q9rTqv61jz1TMbQgSC21Y",
|
3189
|
+
"name": "pfwgw1KVkaL-Jspb7XsLn " + __webpack_require__(17).locals["fieldName"] + "",
|
3190
|
+
"argumentName": "_3qTEJI-SGaaBwcproq96Z9 " + __webpack_require__(17).locals["argumentName"] + "",
|
3191
|
+
"defaultValue": "_1C3jrn92-2_teD3Q_-WwDn " + __webpack_require__(17).locals["defaultValue"] + ""
|
3192
|
+
};
|
3193
|
+
|
3194
|
+
/***/ },
|
3195
|
+
/* 20 */
|
3196
|
+
/***/ function(module, exports, __webpack_require__) {
|
3197
|
+
|
3198
|
+
'use strict';
|
3199
|
+
|
3200
|
+
Object.defineProperty(exports, "__esModule", {
|
3201
|
+
value: true
|
3202
|
+
});
|
3203
|
+
exports.FieldArgumentsTableView = undefined;
|
3204
|
+
|
3205
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
3206
|
+
|
3207
|
+
var _react = __webpack_require__(1);
|
3208
|
+
|
3209
|
+
var _react2 = _interopRequireDefault(_react);
|
3210
|
+
|
3211
|
+
var _model = __webpack_require__(3);
|
3212
|
+
|
3213
|
+
var _TypeRefView = __webpack_require__(14);
|
3214
|
+
|
3215
|
+
var _DescriptionView = __webpack_require__(6);
|
3216
|
+
|
3217
|
+
var _FieldArgumentsTableView = __webpack_require__(21);
|
3218
|
+
|
3219
|
+
var StyleSheet = _interopRequireWildcard(_FieldArgumentsTableView);
|
3220
|
+
|
3221
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
3222
|
+
|
3223
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
3224
|
+
|
3225
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
3226
|
+
|
3227
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
3228
|
+
|
3229
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
3230
|
+
|
3231
|
+
var FieldArgumentsTableView = exports.FieldArgumentsTableView = function (_React$Component) {
|
3232
|
+
_inherits(FieldArgumentsTableView, _React$Component);
|
3233
|
+
|
3234
|
+
function FieldArgumentsTableView() {
|
3235
|
+
_classCallCheck(this, FieldArgumentsTableView);
|
3236
|
+
|
3237
|
+
return _possibleConstructorReturn(this, (FieldArgumentsTableView.__proto__ || Object.getPrototypeOf(FieldArgumentsTableView)).apply(this, arguments));
|
3238
|
+
}
|
3239
|
+
|
3240
|
+
_createClass(FieldArgumentsTableView, [{
|
3241
|
+
key: 'render',
|
3242
|
+
value: function render() {
|
3243
|
+
var _this2 = this;
|
3244
|
+
|
3245
|
+
var withDescription = this.props.args.filter(function (a) {
|
3246
|
+
return a.description;
|
3247
|
+
});
|
3248
|
+
|
3249
|
+
if (!withDescription.length) {
|
3250
|
+
return null;
|
3251
|
+
}
|
3252
|
+
|
3253
|
+
return _react2.default.createElement(
|
3254
|
+
'table',
|
3255
|
+
{ className: StyleSheet.table },
|
3256
|
+
_react2.default.createElement(
|
3257
|
+
'thead',
|
3258
|
+
null,
|
3259
|
+
_react2.default.createElement(
|
3260
|
+
'tr',
|
3261
|
+
null,
|
3262
|
+
_react2.default.createElement(
|
3263
|
+
'th',
|
3264
|
+
{
|
3265
|
+
colSpan: '2',
|
3266
|
+
className: StyleSheet.header
|
3267
|
+
},
|
3268
|
+
'Arguments'
|
3269
|
+
)
|
3270
|
+
)
|
3271
|
+
),
|
3272
|
+
_react2.default.createElement(
|
3273
|
+
'tbody',
|
3274
|
+
null,
|
3275
|
+
withDescription.map(function (a) {
|
3276
|
+
return _this2.renderRow(a);
|
3277
|
+
})
|
3278
|
+
)
|
3279
|
+
);
|
3280
|
+
}
|
3281
|
+
}, {
|
3282
|
+
key: 'renderRow',
|
3283
|
+
value: function renderRow(arg) {
|
3284
|
+
return _react2.default.createElement(
|
3285
|
+
'tr',
|
3286
|
+
{ key: arg.name, className: StyleSheet.row },
|
3287
|
+
_react2.default.createElement(
|
3288
|
+
'td',
|
3289
|
+
{
|
3290
|
+
className: StyleSheet.key
|
3291
|
+
},
|
3292
|
+
_react2.default.createElement(
|
3293
|
+
'span',
|
3294
|
+
{ className: StyleSheet.argumentName },
|
3295
|
+
arg.name
|
3296
|
+
),
|
3297
|
+
': ',
|
3298
|
+
_react2.default.createElement(_TypeRefView.TypeRefView, { typeRef: arg.type })
|
3299
|
+
),
|
3300
|
+
_react2.default.createElement(
|
3301
|
+
'td',
|
3302
|
+
{
|
3303
|
+
className: StyleSheet.value
|
3304
|
+
},
|
3305
|
+
arg.description && _react2.default.createElement(_DescriptionView.DescriptionView, { description: arg.description })
|
3306
|
+
)
|
3307
|
+
);
|
3308
|
+
}
|
3309
|
+
}]);
|
3310
|
+
|
3311
|
+
return FieldArgumentsTableView;
|
3312
|
+
}(_react2.default.Component);
|
3313
|
+
|
3314
|
+
/***/ },
|
3315
|
+
/* 21 */
|
3316
|
+
/***/ function(module, exports, __webpack_require__) {
|
3317
|
+
|
3318
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
3319
|
+
|
3320
|
+
// load the styles
|
3321
|
+
var content = __webpack_require__(22);
|
3322
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
3323
|
+
// add the styles to the DOM
|
3324
|
+
var update = __webpack_require__(11)(content, {});
|
3325
|
+
if(content.locals) module.exports = content.locals;
|
3326
|
+
// Hot Module Replacement
|
3327
|
+
if(false) {
|
3328
|
+
// When the styles change, update the <style> tags
|
3329
|
+
if(!content.locals) {
|
3330
|
+
module.hot.accept("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./FieldArgumentsTableView.css", function() {
|
3331
|
+
var newContent = require("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./FieldArgumentsTableView.css");
|
3332
|
+
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
3333
|
+
update(newContent);
|
3334
|
+
});
|
3335
|
+
}
|
3336
|
+
// When the module is disposed, remove the <style> tags
|
3337
|
+
module.hot.dispose(function() { update(); });
|
3338
|
+
}
|
3339
|
+
|
3340
|
+
/***/ },
|
3341
|
+
/* 22 */
|
3342
|
+
/***/ function(module, exports, __webpack_require__) {
|
3343
|
+
|
3344
|
+
exports = module.exports = __webpack_require__(10)();
|
3345
|
+
// imports
|
3346
|
+
exports.i(__webpack_require__(17), undefined);
|
3347
|
+
|
3348
|
+
// module
|
3349
|
+
exports.push([module.id, "._2u0NKWFUVO10_7zl5FH1bX {\n margin-top: 16px;\n margin-top: 1rem;\n margin-left: 32px;\n margin-left: 2rem;\n width: calc(100% - 2rem);\n}\n\n._14Noc9w-o_IUonJxsVOnBQ {\n text-align: left;\n font-size: 17.6px;\n font-size: 1.1rem;\n border-bottom: 1px solid #d9d9d9;\n}\n\n._3qzzdu41HzTOjXefzRE8dy {\n}\n\n._3g8_wlJYIQqfvRx4Tdzt4u {\n width: 100%;\n}\n\n._1XONXofpDzZZq1kxZDtU2p {\n}\n\n.Sb22PNqbe2ZV1oFtChBAD {\n}\n", ""]);
|
3350
|
+
|
3351
|
+
// exports
|
3352
|
+
exports.locals = {
|
3353
|
+
"table": "_2u0NKWFUVO10_7zl5FH1bX",
|
3354
|
+
"header": "_14Noc9w-o_IUonJxsVOnBQ",
|
3355
|
+
"key": "_3qzzdu41HzTOjXefzRE8dy " + __webpack_require__(17).locals["argumentCell"] + "",
|
3356
|
+
"value": "_3g8_wlJYIQqfvRx4Tdzt4u",
|
3357
|
+
"row": "_1XONXofpDzZZq1kxZDtU2p " + __webpack_require__(17).locals["argumentRow"] + "",
|
3358
|
+
"argumentName": "Sb22PNqbe2ZV1oFtChBAD " + __webpack_require__(17).locals["argumentName"] + ""
|
3359
|
+
};
|
3360
|
+
|
3361
|
+
/***/ },
|
3362
|
+
/* 23 */
|
3363
|
+
/***/ function(module, exports, __webpack_require__) {
|
3364
|
+
|
3365
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
3366
|
+
|
3367
|
+
// load the styles
|
3368
|
+
var content = __webpack_require__(24);
|
3369
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
3370
|
+
// add the styles to the DOM
|
3371
|
+
var update = __webpack_require__(11)(content, {});
|
3372
|
+
if(content.locals) module.exports = content.locals;
|
3373
|
+
// Hot Module Replacement
|
3374
|
+
if(false) {
|
3375
|
+
// When the styles change, update the <style> tags
|
3376
|
+
if(!content.locals) {
|
3377
|
+
module.hot.accept("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./FieldView.css", function() {
|
3378
|
+
var newContent = require("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./FieldView.css");
|
3379
|
+
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
3380
|
+
update(newContent);
|
3381
|
+
});
|
3382
|
+
}
|
3383
|
+
// When the module is disposed, remove the <style> tags
|
3384
|
+
module.hot.dispose(function() { update(); });
|
3385
|
+
}
|
3386
|
+
|
3387
|
+
/***/ },
|
3388
|
+
/* 24 */
|
3389
|
+
/***/ function(module, exports, __webpack_require__) {
|
3390
|
+
|
3391
|
+
exports = module.exports = __webpack_require__(10)();
|
3392
|
+
// imports
|
3393
|
+
|
3394
|
+
|
3395
|
+
// module
|
3396
|
+
exports.push([module.id, "._2CI__araY4C94OAnkGP8Fv {\n margin-bottom: 24px;\n margin-bottom: 1.5rem;\n}\n\n._158AUimPZVUE217-1MuDQx {\n margin-left: 32px;\n margin-left: 2rem;\n}\n\n._158AUimPZVUE217-1MuDQx p {\n margin-top: 0;\n}\n", ""]);
|
3397
|
+
|
3398
|
+
// exports
|
3399
|
+
exports.locals = {
|
3400
|
+
"container": "_2CI__araY4C94OAnkGP8Fv",
|
3401
|
+
"description": "_158AUimPZVUE217-1MuDQx"
|
3402
|
+
};
|
3403
|
+
|
3404
|
+
/***/ },
|
3405
|
+
/* 25 */
|
3406
|
+
/***/ function(module, exports, __webpack_require__) {
|
3407
|
+
|
3408
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
3409
|
+
|
3410
|
+
// load the styles
|
3411
|
+
var content = __webpack_require__(26);
|
3412
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
3413
|
+
// add the styles to the DOM
|
3414
|
+
var update = __webpack_require__(11)(content, {});
|
3415
|
+
if(content.locals) module.exports = content.locals;
|
3416
|
+
// Hot Module Replacement
|
3417
|
+
if(false) {
|
3418
|
+
// When the styles change, update the <style> tags
|
3419
|
+
if(!content.locals) {
|
3420
|
+
module.hot.accept("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./TypeDocsViews.css", function() {
|
3421
|
+
var newContent = require("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./TypeDocsViews.css");
|
3422
|
+
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
3423
|
+
update(newContent);
|
3424
|
+
});
|
3425
|
+
}
|
3426
|
+
// When the module is disposed, remove the <style> tags
|
3427
|
+
module.hot.dispose(function() { update(); });
|
3428
|
+
}
|
3429
|
+
|
3430
|
+
/***/ },
|
3431
|
+
/* 26 */
|
3432
|
+
/***/ function(module, exports, __webpack_require__) {
|
3433
|
+
|
3434
|
+
exports = module.exports = __webpack_require__(10)();
|
3435
|
+
// imports
|
3436
|
+
exports.i(__webpack_require__(17), undefined);
|
3437
|
+
|
3438
|
+
// module
|
3439
|
+
exports.push([module.id, "._31nGuA4VcO5ASJ1Y-50NC0 {\n margin-bottom: 20px;\n}\n\n._1hBwBkrQ8ZlOyOUcLvjRpt {\n margin-bottom: 8px;\n margin-bottom: 0.5rem;\n}\n\n._1gsHTtZCfZy0kwT90S9nZC {\n -webkit-font-feature-settings: \"c2sc\";\n font-feature-settings: \"c2sc\";\n font-variant: small-caps;\n text-transform: uppercase;\n font-weight: bold;\n color: #4a4a4a;\n border-bottom: 1px solid #d9d9d9;\n margin-top: 16px;\n margin-top: 1rem;\n margin-bottom: 8px;\n margin-bottom: 0.5rem;\n}\n\n._2rkCQUiZ63eNMyTCRDL7GX {\n list-style: none;\n margin: 0;\n padding: 0;\n}\n\n.hI41jTQ51eUSGSCTegJoD {\n}\n\n.bHFx-gWNy1lALB9MKGx6U {\n}\n", ""]);
|
3440
|
+
|
3441
|
+
// exports
|
3442
|
+
exports.locals = {
|
3443
|
+
"type": "_31nGuA4VcO5ASJ1Y-50NC0",
|
3444
|
+
"heading": "_1hBwBkrQ8ZlOyOUcLvjRpt",
|
3445
|
+
"subHeading": "_1gsHTtZCfZy0kwT90S9nZC",
|
3446
|
+
"interfacesList": "_2rkCQUiZ63eNMyTCRDL7GX",
|
3447
|
+
"enumName": "hI41jTQ51eUSGSCTegJoD " + __webpack_require__(17).locals["argumentName"] + " " + __webpack_require__(17).locals["argumentCell"] + "",
|
3448
|
+
"enumRow": "bHFx-gWNy1lALB9MKGx6U " + __webpack_require__(17).locals["argumentRow"] + ""
|
3449
|
+
};
|
3450
|
+
|
3451
|
+
/***/ },
|
3452
|
+
/* 27 */
|
3453
|
+
/***/ function(module, exports, __webpack_require__) {
|
3454
|
+
|
3455
|
+
// style-loader: Adds some css to the DOM by adding a <style> tag
|
3456
|
+
|
3457
|
+
// load the styles
|
3458
|
+
var content = __webpack_require__(28);
|
3459
|
+
if(typeof content === 'string') content = [[module.id, content, '']];
|
3460
|
+
// add the styles to the DOM
|
3461
|
+
var update = __webpack_require__(11)(content, {});
|
3462
|
+
if(content.locals) module.exports = content.locals;
|
3463
|
+
// Hot Module Replacement
|
3464
|
+
if(false) {
|
3465
|
+
// When the styles change, update the <style> tags
|
3466
|
+
if(!content.locals) {
|
3467
|
+
module.hot.accept("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./SchemaDocsView.css", function() {
|
3468
|
+
var newContent = require("!!./../../node_modules/css-loader/index.js?modules&importLoaders=1!./../../node_modules/postcss-loader/index.js!./SchemaDocsView.css");
|
3469
|
+
if(typeof newContent === 'string') newContent = [[module.id, newContent, '']];
|
3470
|
+
update(newContent);
|
3471
|
+
});
|
3472
|
+
}
|
3473
|
+
// When the module is disposed, remove the <style> tags
|
3474
|
+
module.hot.dispose(function() { update(); });
|
3475
|
+
}
|
3476
|
+
|
3477
|
+
/***/ },
|
3478
|
+
/* 28 */
|
3479
|
+
/***/ function(module, exports, __webpack_require__) {
|
3480
|
+
|
3481
|
+
exports = module.exports = __webpack_require__(10)();
|
3482
|
+
// imports
|
3483
|
+
exports.i(__webpack_require__(29), "");
|
3484
|
+
|
3485
|
+
// module
|
3486
|
+
exports.push([module.id, "._2Wa9wu-awiDVZ9IXTPcyFt {\n display: -webkit-box;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-pack: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n\n._38MtHDcUga2pYTxIRJJZ8o {\n max-width: 800px;\n}\n", ""]);
|
3487
|
+
|
3488
|
+
// exports
|
3489
|
+
exports.locals = {
|
3490
|
+
"wrapper": "_2Wa9wu-awiDVZ9IXTPcyFt",
|
3491
|
+
"container": "_38MtHDcUga2pYTxIRJJZ8o"
|
3492
|
+
};
|
3493
|
+
|
3494
|
+
/***/ },
|
3495
|
+
/* 29 */
|
3496
|
+
/***/ function(module, exports, __webpack_require__) {
|
3497
|
+
|
3498
|
+
exports = module.exports = __webpack_require__(10)();
|
3499
|
+
// imports
|
3500
|
+
|
3501
|
+
|
3502
|
+
// module
|
3503
|
+
exports.push([module.id, "/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */\n\n* {\n box-sizing: border-box;\n}\n\n/**\n * 1. Change the default font family in all browsers (opinionated).\n * 2. Prevent adjustments of font size after orientation changes in IE and iOS.\n */\n\nhtml {\n font-family: -apple-system, BlinkMacSystemFont,\n \"Segoe UI\", \"Roboto\", \"Oxygen\", \"Ubuntu\", \"Cantarell\",\n \"Fira Sans\", \"Droid Sans\", \"Helvetica Neue\",\n sans-serif; /* 1 */\n -ms-text-size-adjust: 100%; /* 2 */\n -webkit-text-size-adjust: 100%; /* 2 */\n}\n\n/**\n * Remove the margin in all browsers (opinionated).\n */\n\nbody {\n margin: 0 8px;\n}\n\n/* HTML5 display definitions\n ========================================================================== */\n\n/**\n * Add the correct display in IE 9-.\n * 1. Add the correct display in Edge, IE, and Firefox.\n * 2. Add the correct display in IE.\n */\n\narticle,\naside,\ndetails, /* 1 */\nfigcaption,\nfigure,\nfooter,\nheader,\nmain, /* 2 */\nmenu,\nnav,\nsection,\nsummary { /* 1 */\n display: block;\n}\n\n/**\n * Add the correct display in IE 9-.\n */\n\naudio,\ncanvas,\nprogress,\nvideo {\n display: inline-block;\n}\n\n/**\n * Add the correct display in iOS 4-7.\n */\n\naudio:not([controls]) {\n display: none;\n height: 0;\n}\n\n/**\n * Add the correct vertical alignment in Chrome, Firefox, and Opera.\n */\n\nprogress {\n vertical-align: baseline;\n}\n\n/**\n * Add the correct display in IE 10-.\n * 1. Add the correct display in IE.\n */\n\ntemplate, /* 1 */\n[hidden] {\n display: none;\n}\n\n/* Links\n ========================================================================== */\n\n/**\n * 1. Remove the gray background on active links in IE 10.\n * 2. Remove gaps in links underline in iOS 8+ and Safari 8+.\n */\n\na {\n background-color: transparent; /* 1 */\n -webkit-text-decoration-skip: ink; /* 2 */\n}\n\n/**\n * Remove the outline on focused links when they are also active or hovered\n * in all browsers (opinionated).\n */\n\na:active,\na:hover {\n outline-width: 0;\n}\n\n/* Text-level semantics\n ========================================================================== */\n\n/**\n * 1. Remove the bottom border in Firefox 39-.\n * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n */\n\nabbr[title] {\n border-bottom: none; /* 1 */\n text-decoration: underline; /* 2 */\n text-decoration: underline dotted; /* 2 */\n}\n\n/**\n * Prevent the duplicate application of `bolder` by the next rule in Safari 6.\n */\n\nb,\nstrong {\n font-weight: inherit;\n}\n\n/**\n * Add the correct font weight in Chrome, Edge, and Safari.\n */\n\nb,\nstrong {\n font-weight: bolder;\n}\n\n/**\n * Add the correct font style in Android 4.3-.\n */\n\ndfn {\n font-style: italic;\n}\n\n/**\n * Correct the font size and margin on `h1` elements within `section` and\n * `article` contexts in Chrome, Firefox, and Safari.\n */\n\nh1 {\n font-size: 2em;\n margin: 0.67em 0;\n}\n\n/**\n * Add the correct background and color in IE 9-.\n */\n\nmark {\n background-color: #ff0;\n color: #000;\n}\n\n/**\n * Add the correct font size in all browsers.\n */\n\nsmall {\n font-size: 80%;\n}\n\n/**\n * Prevent `sub` and `sup` elements from affecting the line height in\n * all browsers.\n */\n\nsub,\nsup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -0.25em;\n}\n\nsup {\n top: -0.5em;\n}\n\n/* Embedded content\n ========================================================================== */\n\n/**\n * Remove the border on images inside links in IE 10-.\n */\n\nimg {\n border-style: none;\n}\n\n/**\n * Hide the overflow in IE.\n */\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\n/* Grouping content\n ========================================================================== */\n\n/**\n * 1. Correct the inheritance and scaling of font size in all browsers.\n * 2. Correct the odd `em` font sizing in all browsers.\n */\n\ncode,\nkbd,\npre,\nsamp {\n font-family: monospace, monospace; /* 1 */\n font-size: 1em; /* 2 */\n}\n\n/**\n * Add the correct margin in IE 8.\n */\n\nfigure {\n margin: 1em 40px;\n}\n\n/**\n * 1. Add the correct box sizing in Firefox.\n * 2. Show the overflow in Edge and IE.\n */\n\nhr {\n box-sizing: content-box; /* 1 */\n height: 0; /* 1 */\n overflow: visible; /* 2 */\n}\n\n/* Forms\n ========================================================================== */\n\n/**\n * 1. Change font properties to `inherit` in all browsers (opinionated).\n * 2. Remove the margin in Firefox and Safari.\n */\n\nbutton,\ninput,\noptgroup,\nselect,\ntextarea {\n font: inherit; /* 1 */\n margin: 0; /* 2 */\n}\n\n/**\n * Restore the font weight unset by the previous rule.\n */\n\noptgroup {\n font-weight: bold;\n}\n\n/**\n * Show the overflow in IE.\n * 1. Show the overflow in Edge.\n */\n\nbutton,\ninput { /* 1 */\n overflow: visible;\n}\n\n/**\n * Remove the inheritance of text transform in Edge, Firefox, and IE.\n * 1. Remove the inheritance of text transform in Firefox.\n */\n\nbutton,\nselect { /* 1 */\n text-transform: none;\n}\n\n/**\n * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`\n * controls in Android 4.\n * 2. Correct the inability to style clickable types in iOS and Safari.\n */\n\nbutton,\nhtml [type=\"button\"], /* 1 */\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button; /* 2 */\n}\n\n/**\n * Remove the inner border and padding in Firefox.\n */\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n border-style: none;\n padding: 0;\n}\n\n/**\n * Restore the focus styles unset by the previous rule.\n */\n\nbutton:-moz-focusring,\n[type=\"button\"]:-moz-focusring,\n[type=\"reset\"]:-moz-focusring,\n[type=\"submit\"]:-moz-focusring {\n outline: 1px dotted ButtonText;\n}\n\n/**\n * Change the border, margin, and padding in all browsers (opinionated).\n */\n\nfieldset {\n border: 1px solid #c0c0c0;\n margin: 0 2px;\n padding: 0.35em 0.625em 0.75em;\n}\n\n/**\n * 1. Correct the text wrapping in Edge and IE.\n * 2. Correct the color inheritance from `fieldset` elements in IE.\n * 3. Remove the padding so developers are not caught out when they zero out\n * `fieldset` elements in all browsers.\n */\n\nlegend {\n box-sizing: border-box; /* 1 */\n color: inherit; /* 2 */\n display: table; /* 1 */\n max-width: 100%; /* 1 */\n padding: 0; /* 3 */\n white-space: normal; /* 1 */\n}\n\n/**\n * Remove the default vertical scrollbar in IE.\n */\n\ntextarea {\n overflow: auto;\n}\n\n/**\n * 1. Add the correct box sizing in IE 10-.\n * 2. Remove the padding in IE 10-.\n */\n\n[type=\"checkbox\"],\n[type=\"radio\"] {\n box-sizing: border-box; /* 1 */\n padding: 0; /* 2 */\n}\n\n/**\n * Correct the cursor style of increment and decrement buttons in Chrome.\n */\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n/**\n * 1. Correct the odd appearance in Chrome and Safari.\n * 2. Correct the outline style in Safari.\n */\n\n[type=\"search\"] {\n -webkit-appearance: textfield; /* 1 */\n outline-offset: -2px; /* 2 */\n}\n\n/**\n * Remove the inner padding and cancel buttons in Chrome and Safari on OS X.\n */\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n/**\n * Correct the text style of placeholders in Chrome, Edge, and Safari.\n */\n\n::-webkit-input-placeholder {\n color: inherit;\n opacity: 0.54;\n}\n\n/**\n * 1. Correct the inability to style clickable types in iOS and Safari.\n * 2. Change font properties to `inherit` in Safari.\n */\n\n::-webkit-file-upload-button {\n -webkit-appearance: button; /* 1 */\n font: inherit; /* 2 */\n}\n", ""]);
|
3504
|
+
|
3505
|
+
// exports
|
3506
|
+
|
3507
|
+
|
3508
|
+
/***/ },
|
3509
|
+
/* 30 */
|
3510
|
+
/***/ function(module, exports) {
|
3511
|
+
|
3512
|
+
module.exports = "query IntrospectionQuery {\n __schema {\n queryType {\n name\n }\n mutationType {\n name\n }\n subscriptionType {\n name\n }\n types {\n ...FullType\n }\n directives {\n name\n description\n args {\n ...InputValue\n }\n onOperation\n onFragment\n onField\n }\n }\n}\n\nfragment FullType on __Type {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type {\n ...TypeRef\n }\n defaultValue\n}\n\nfragment TypeRef on __Type {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n}\n\n"
|
3513
|
+
|
3514
|
+
/***/ }
|
3515
|
+
/******/ ])
|
3516
|
+
});
|
3517
|
+
;
|
3518
|
+
//# sourceMappingURL=graphql-docs.js.map
|