UNPKG

25.6 kBJavaScriptView Raw
1"use strict";
2
3require("core-js/modules/es.symbol.js");
4
5Object.defineProperty(exports, "__esModule", {
6 value: true
7});
8exports.init = void 0;
9
10require("regenerator-runtime/runtime.js");
11
12require("core-js/modules/es.object.to-string.js");
13
14require("core-js/modules/es.promise.js");
15
16require("core-js/modules/web.dom-collections.for-each.js");
17
18require("core-js/modules/es.object.keys.js");
19
20require("core-js/modules/es.array.find.js");
21
22require("core-js/modules/es.regexp.exec.js");
23
24require("core-js/modules/es.string.split.js");
25
26require("core-js/modules/es.array.includes.js");
27
28require("core-js/modules/es.array.concat.js");
29
30require("core-js/modules/es.function.name.js");
31
32require("core-js/modules/es.array.find-index.js");
33
34require("core-js/modules/es.string.includes.js");
35
36require("core-js/modules/es.object.assign.js");
37
38require("core-js/modules/es.array.filter.js");
39
40require("core-js/modules/es.array.from.js");
41
42require("core-js/modules/es.string.iterator.js");
43
44require("core-js/modules/es.array.iterator.js");
45
46require("core-js/modules/es.set.js");
47
48require("core-js/modules/web.dom-collections.iterator.js");
49
50var _global = _interopRequireDefault(require("global"));
51
52var _csf = require("@storybook/csf");
53
54var _coreEvents = require("@storybook/core-events");
55
56var _utilDeprecate = _interopRequireDefault(require("util-deprecate"));
57
58var _clientLogger = require("@storybook/client-logger");
59
60var _events = require("../lib/events");
61
62var _stories2 = require("../lib/stories");
63
64var _excluded = ["id"],
65 _excluded2 = ["kind", "story", "storyId"];
66
67function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
68
69function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
70
71function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
72
73function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
74
75function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
76
77var DOCS_MODE = _global.default.DOCS_MODE,
78 FEATURES = _global.default.FEATURES,
79 fetch = _global.default.fetch;
80var STORY_INDEX_PATH = './stories.json';
81var deprecatedOptionsParameterWarnings = ['enableShortcuts', 'theme', 'showRoots'].reduce(function (acc, option) {
82 acc[option] = (0, _utilDeprecate.default)(function () {}, "parameters.options.".concat(option, " is deprecated and will be removed in Storybook 7.0.\nTo change this setting, use `addons.setConfig`. See https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#deprecated-immutable-options-parameters\n "));
83 return acc;
84}, {});
85
86function checkDeprecatedOptionParameters(options) {
87 if (!options) {
88 return;
89 }
90
91 Object.keys(options).forEach(function (option) {
92 if (deprecatedOptionsParameterWarnings[option]) {
93 deprecatedOptionsParameterWarnings[option]();
94 }
95 });
96}
97
98var init = function init(_ref) {
99 var fullAPI = _ref.fullAPI,
100 store = _ref.store,
101 navigate = _ref.navigate,
102 provider = _ref.provider,
103 initialStoryId = _ref.storyId,
104 initialViewMode = _ref.viewMode;
105 var api = {
106 storyId: _csf.toId,
107 getData: function getData(storyId, refId) {
108 var result = api.resolveStory(storyId, refId);
109 return (0, _stories2.isRoot)(result) ? undefined : result;
110 },
111 isPrepared: function isPrepared(storyId, refId) {
112 var data = api.getData(storyId, refId);
113
114 if (data.isLeaf) {
115 return data.prepared;
116 } // Groups are always prepared :shrug:
117
118
119 return true;
120 },
121 resolveStory: function resolveStory(storyId, refId) {
122 var _store$getState = store.getState(),
123 refs = _store$getState.refs,
124 storiesHash = _store$getState.storiesHash;
125
126 if (refId) {
127 return refs[refId].stories ? refs[refId].stories[storyId] : undefined;
128 }
129
130 return storiesHash ? storiesHash[storyId] : undefined;
131 },
132 getCurrentStoryData: function getCurrentStoryData() {
133 var _store$getState2 = store.getState(),
134 storyId = _store$getState2.storyId,
135 refId = _store$getState2.refId;
136
137 return api.getData(storyId, refId);
138 },
139 getParameters: function getParameters(storyIdOrCombo, parameterName) {
140 var _ref2 = typeof storyIdOrCombo === 'string' ? {
141 storyId: storyIdOrCombo,
142 refId: undefined
143 } : storyIdOrCombo,
144 storyId = _ref2.storyId,
145 refId = _ref2.refId;
146
147 var data = api.getData(storyId, refId);
148
149 if ((0, _stories2.isStory)(data)) {
150 var parameters = data.parameters;
151
152 if (parameters) {
153 return parameterName ? parameters[parameterName] : parameters;
154 }
155
156 return {};
157 }
158
159 return null;
160 },
161 getCurrentParameter: function getCurrentParameter(parameterName) {
162 var _store$getState3 = store.getState(),
163 storyId = _store$getState3.storyId,
164 refId = _store$getState3.refId;
165
166 var parameters = api.getParameters({
167 storyId: storyId,
168 refId: refId
169 }, parameterName); // FIXME Returning falsey parameters breaks a bunch of toolbars code,
170 // so this strange logic needs to be here until various client code is updated.
171
172 return parameters || undefined;
173 },
174 jumpToComponent: function jumpToComponent(direction) {
175 var _store$getState4 = store.getState(),
176 storiesHash = _store$getState4.storiesHash,
177 storyId = _store$getState4.storyId,
178 refs = _store$getState4.refs,
179 refId = _store$getState4.refId;
180
181 var story = api.getData(storyId, refId); // cannot navigate when there's no current selection
182
183 if (!story) {
184 return;
185 }
186
187 var hash = refId ? refs[refId].stories || {} : storiesHash;
188 var result = api.findSiblingStoryId(storyId, hash, direction, true);
189
190 if (result) {
191 api.selectStory(result, undefined, {
192 ref: refId
193 });
194 }
195 },
196 jumpToStory: function jumpToStory(direction) {
197 var _store$getState5 = store.getState(),
198 storiesHash = _store$getState5.storiesHash,
199 storyId = _store$getState5.storyId,
200 refs = _store$getState5.refs,
201 refId = _store$getState5.refId;
202
203 var story = api.getData(storyId, refId);
204
205 if (DOCS_MODE) {
206 api.jumpToComponent(direction);
207 return;
208 } // cannot navigate when there's no current selection
209
210
211 if (!story) {
212 return;
213 }
214
215 var hash = story.refId ? refs[story.refId].stories : storiesHash;
216 var result = api.findSiblingStoryId(storyId, hash, direction, false);
217
218 if (result) {
219 api.selectStory(result, undefined, {
220 ref: refId
221 });
222 }
223 },
224 setStories: function () {
225 var _setStories = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(input, error) {
226 var hash;
227 return regeneratorRuntime.wrap(function _callee$(_context) {
228 while (1) {
229 switch (_context.prev = _context.next) {
230 case 0:
231 // Now create storiesHash by reordering the above by group
232 hash = (0, _stories2.transformStoriesRawToStoriesHash)(input, {
233 provider: provider
234 });
235 _context.next = 3;
236 return store.setState({
237 storiesHash: hash,
238 storiesConfigured: true,
239 storiesFailed: error
240 });
241
242 case 3:
243 case "end":
244 return _context.stop();
245 }
246 }
247 }, _callee);
248 }));
249
250 function setStories(_x, _x2) {
251 return _setStories.apply(this, arguments);
252 }
253
254 return setStories;
255 }(),
256 selectFirstStory: function selectFirstStory() {
257 var _store$getState6 = store.getState(),
258 storiesHash = _store$getState6.storiesHash;
259
260 var firstStory = Object.keys(storiesHash).find(function (k) {
261 return !(storiesHash[k].children || Array.isArray(storiesHash[k]));
262 });
263
264 if (firstStory) {
265 api.selectStory(firstStory);
266 return;
267 }
268
269 navigate('/');
270 },
271 selectStory: function selectStory() {
272 var kindOrId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
273 var story = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
274 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
275 var ref = options.ref,
276 viewModeFromArgs = options.viewMode;
277
278 var _store$getState7 = store.getState(),
279 _store$getState7$view = _store$getState7.viewMode,
280 viewModeFromState = _store$getState7$view === void 0 ? 'story' : _store$getState7$view,
281 storyId = _store$getState7.storyId,
282 storiesHash = _store$getState7.storiesHash,
283 refs = _store$getState7.refs;
284
285 var hash = ref ? refs[ref].stories : storiesHash;
286 var kindSlug = storyId === null || storyId === void 0 ? void 0 : storyId.split('--', 2)[0];
287
288 if (!story) {
289 var s = kindOrId ? hash[kindOrId] || hash[(0, _csf.sanitize)(kindOrId)] : hash[kindSlug]; // eslint-disable-next-line no-nested-ternary
290
291 var id = s ? s.children ? s.children[0] : s.id : kindOrId;
292 var viewMode = s && !(0, _stories2.isRoot)(s) && (viewModeFromArgs || s.parameters.viewMode) ? s.parameters.viewMode : viewModeFromState; // Some viewModes are not story-specific, and we should reset viewMode
293 // to 'story' if one of those is active when navigating to another story
294
295 if (['settings', 'about', 'release'].includes(viewMode)) {
296 viewMode = 'story';
297 }
298
299 var p = s && s.refId ? "/".concat(viewMode, "/").concat(s.refId, "_").concat(id) : "/".concat(viewMode, "/").concat(id);
300 navigate(p);
301 } else if (!kindOrId) {
302 // This is a slugified version of the kind, but that's OK, our toId function is idempotent
303 var _id = (0, _csf.toId)(kindSlug, story);
304
305 api.selectStory(_id, undefined, options);
306 } else {
307 var _id2 = ref ? "".concat(ref, "_").concat((0, _csf.toId)(kindOrId, story)) : (0, _csf.toId)(kindOrId, story);
308
309 if (hash[_id2]) {
310 api.selectStory(_id2, undefined, options);
311 } else {
312 // Support legacy API with component permalinks, where kind is `x/y` but permalink is 'z'
313 var _k = hash[(0, _csf.sanitize)(kindOrId)];
314
315 if (_k && _k.children) {
316 var foundId = _k.children.find(function (childId) {
317 return hash[childId].name === story;
318 });
319
320 if (foundId) {
321 api.selectStory(foundId, undefined, options);
322 }
323 }
324 }
325 }
326 },
327 findLeafStoryId: function findLeafStoryId(storiesHash, storyId) {
328 if (storiesHash[storyId].isLeaf) {
329 return storyId;
330 }
331
332 var childStoryId = storiesHash[storyId].children[0];
333 return api.findLeafStoryId(storiesHash, childStoryId);
334 },
335 findSiblingStoryId: function findSiblingStoryId(storyId, hash, direction, toSiblingGroup) {
336 if (toSiblingGroup) {
337 var _lookupList = (0, _stories2.getComponentLookupList)(hash);
338
339 var _index = _lookupList.findIndex(function (i) {
340 return i.includes(storyId);
341 }); // cannot navigate beyond fist or last
342
343
344 if (_index === _lookupList.length - 1 && direction > 0) {
345 return;
346 }
347
348 if (_index === 0 && direction < 0) {
349 return;
350 }
351
352 if (_lookupList[_index + direction]) {
353 // eslint-disable-next-line consistent-return
354 return _lookupList[_index + direction][0];
355 }
356
357 return;
358 }
359
360 var lookupList = (0, _stories2.getStoriesLookupList)(hash);
361 var index = lookupList.indexOf(storyId); // cannot navigate beyond fist or last
362
363 if (index === lookupList.length - 1 && direction > 0) {
364 return;
365 }
366
367 if (index === 0 && direction < 0) {
368 return;
369 } // eslint-disable-next-line consistent-return
370
371
372 return lookupList[index + direction];
373 },
374 updateStoryArgs: function updateStoryArgs(story, updatedArgs) {
375 var storyId = story.id,
376 refId = story.refId;
377 fullAPI.emit(_coreEvents.UPDATE_STORY_ARGS, {
378 storyId: storyId,
379 updatedArgs: updatedArgs,
380 options: {
381 target: refId ? "storybook-ref-".concat(refId) : 'storybook-preview-iframe'
382 }
383 });
384 },
385 resetStoryArgs: function resetStoryArgs(story, argNames) {
386 var storyId = story.id,
387 refId = story.refId;
388 fullAPI.emit(_coreEvents.RESET_STORY_ARGS, {
389 storyId: storyId,
390 argNames: argNames,
391 options: {
392 target: refId ? "storybook-ref-".concat(refId) : 'storybook-preview-iframe'
393 }
394 });
395 },
396 fetchStoryList: function () {
397 var _fetchStoryList = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
398 var result, storyIndex;
399 return regeneratorRuntime.wrap(function _callee2$(_context2) {
400 while (1) {
401 switch (_context2.prev = _context2.next) {
402 case 0:
403 _context2.prev = 0;
404 _context2.next = 3;
405 return fetch(STORY_INDEX_PATH);
406
407 case 3:
408 result = _context2.sent;
409
410 if (!(result.status !== 200)) {
411 _context2.next = 10;
412 break;
413 }
414
415 _context2.t0 = Error;
416 _context2.next = 8;
417 return result.text();
418
419 case 8:
420 _context2.t1 = _context2.sent;
421 throw new _context2.t0(_context2.t1);
422
423 case 10:
424 _context2.next = 12;
425 return result.json();
426
427 case 12:
428 storyIndex = _context2.sent;
429
430 if (!(storyIndex.v !== 3)) {
431 _context2.next = 16;
432 break;
433 }
434
435 _clientLogger.logger.warn("Skipping story index with version v".concat(storyIndex.v, ", awaiting SET_STORIES."));
436
437 return _context2.abrupt("return");
438
439 case 16:
440 _context2.next = 18;
441 return fullAPI.setStoryList(storyIndex);
442
443 case 18:
444 _context2.next = 23;
445 break;
446
447 case 20:
448 _context2.prev = 20;
449 _context2.t2 = _context2["catch"](0);
450 store.setState({
451 storiesConfigured: true,
452 storiesFailed: _context2.t2
453 });
454
455 case 23:
456 case "end":
457 return _context2.stop();
458 }
459 }
460 }, _callee2, null, [[0, 20]]);
461 }));
462
463 function fetchStoryList() {
464 return _fetchStoryList.apply(this, arguments);
465 }
466
467 return fetchStoryList;
468 }(),
469 setStoryList: function () {
470 var _setStoryList = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(storyIndex) {
471 var hash;
472 return regeneratorRuntime.wrap(function _callee3$(_context3) {
473 while (1) {
474 switch (_context3.prev = _context3.next) {
475 case 0:
476 hash = (0, _stories2.transformStoryIndexToStoriesHash)(storyIndex, {
477 provider: provider
478 });
479 _context3.next = 3;
480 return store.setState({
481 storiesHash: hash,
482 storiesConfigured: true,
483 storiesFailed: null
484 });
485
486 case 3:
487 case "end":
488 return _context3.stop();
489 }
490 }
491 }, _callee3);
492 }));
493
494 function setStoryList(_x3) {
495 return _setStoryList.apply(this, arguments);
496 }
497
498 return setStoryList;
499 }(),
500 updateStory: function () {
501 var _updateStory = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(storyId, update, ref) {
502 var _store$getState8, storiesHash, _refId, _stories;
503
504 return regeneratorRuntime.wrap(function _callee4$(_context4) {
505 while (1) {
506 switch (_context4.prev = _context4.next) {
507 case 0:
508 if (ref) {
509 _context4.next = 7;
510 break;
511 }
512
513 _store$getState8 = store.getState(), storiesHash = _store$getState8.storiesHash;
514 storiesHash[storyId] = Object.assign({}, storiesHash[storyId], update);
515 _context4.next = 5;
516 return store.setState({
517 storiesHash: storiesHash
518 });
519
520 case 5:
521 _context4.next = 11;
522 break;
523
524 case 7:
525 _refId = ref.id, _stories = ref.stories;
526 _stories[storyId] = Object.assign({}, _stories[storyId], update);
527 _context4.next = 11;
528 return fullAPI.updateRef(_refId, {
529 stories: _stories
530 });
531
532 case 11:
533 case "end":
534 return _context4.stop();
535 }
536 }
537 }, _callee4);
538 }));
539
540 function updateStory(_x4, _x5, _x6) {
541 return _updateStory.apply(this, arguments);
542 }
543
544 return updateStory;
545 }()
546 };
547
548 var initModule = /*#__PURE__*/function () {
549 var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5() {
550 var _provider$serverChann;
551
552 return regeneratorRuntime.wrap(function _callee5$(_context5) {
553 while (1) {
554 switch (_context5.prev = _context5.next) {
555 case 0:
556 // On initial load, the local iframe will select the first story (or other "selection specifier")
557 // and emit STORY_SPECIFIED with the id. We need to ensure we respond to this change.
558 fullAPI.on(_coreEvents.STORY_SPECIFIED, function handler(_ref4) {
559 var storyId = _ref4.storyId,
560 viewMode = _ref4.viewMode;
561
562 var _getEventMetadata = (0, _events.getEventMetadata)(this, fullAPI),
563 sourceType = _getEventMetadata.sourceType;
564
565 if (fullAPI.isSettingsScreenActive()) return;
566
567 if (sourceType === 'local') {
568 // Special case -- if we are already at the story being specified (i.e. the user started at a given story),
569 // we don't need to change URL. See https://github.com/storybookjs/storybook/issues/11677
570 var state = store.getState();
571
572 if (state.storyId !== storyId || state.viewMode !== viewMode) {
573 navigate("/".concat(viewMode, "/").concat(storyId));
574 }
575 }
576 });
577 fullAPI.on(_coreEvents.STORY_CHANGED, function handler() {
578 var _getEventMetadata2 = (0, _events.getEventMetadata)(this, fullAPI),
579 sourceType = _getEventMetadata2.sourceType;
580
581 if (sourceType === 'local') {
582 var options = fullAPI.getCurrentParameter('options');
583
584 if (options) {
585 checkDeprecatedOptionParameters(options);
586 fullAPI.setOptions(options);
587 }
588 }
589 });
590 fullAPI.on(_coreEvents.STORY_PREPARED, function handler(_ref5) {
591 var id = _ref5.id,
592 update = _objectWithoutProperties(_ref5, _excluded);
593
594 var _getEventMetadata3 = (0, _events.getEventMetadata)(this, fullAPI),
595 ref = _getEventMetadata3.ref,
596 sourceType = _getEventMetadata3.sourceType;
597
598 fullAPI.updateStory(id, Object.assign({}, update, {
599 prepared: true
600 }), ref);
601
602 if (!ref) {
603 if (!store.getState().hasCalledSetOptions) {
604 var options = update.parameters.options;
605 checkDeprecatedOptionParameters(options);
606 fullAPI.setOptions(options);
607 store.setState({
608 hasCalledSetOptions: true
609 });
610 }
611 } else {
612 fullAPI.updateRef(ref.id, {
613 ready: true
614 });
615 }
616
617 if (sourceType === 'local') {
618 var _store$getState9 = store.getState(),
619 _storyId = _store$getState9.storyId,
620 storiesHash = _store$getState9.storiesHash; // create a list of related stories to be preloaded
621
622
623 var toBePreloaded = Array.from(new Set([api.findSiblingStoryId(_storyId, storiesHash, 1, true), api.findSiblingStoryId(_storyId, storiesHash, -1, true)])).filter(Boolean);
624 fullAPI.emit(_coreEvents.PRELOAD_STORIES, toBePreloaded);
625 }
626 });
627 fullAPI.on(_coreEvents.SET_STORIES, function handler(data) {
628 var _getEventMetadata4 = (0, _events.getEventMetadata)(this, fullAPI),
629 ref = _getEventMetadata4.ref;
630
631 var stories = data.v ? (0, _stories2.denormalizeStoryParameters)(data) : data.stories;
632
633 if (!ref) {
634 if (!data.v) {
635 throw new Error('Unexpected legacy SET_STORIES event from local source');
636 }
637
638 fullAPI.setStories(stories);
639 var options = fullAPI.getCurrentParameter('options');
640 checkDeprecatedOptionParameters(options);
641 fullAPI.setOptions(options);
642 } else {
643 fullAPI.setRef(ref.id, Object.assign({}, ref, data, {
644 stories: stories
645 }), true);
646 }
647 });
648 fullAPI.on(_coreEvents.SELECT_STORY, function handler(_ref6) {
649 var kind = _ref6.kind,
650 story = _ref6.story,
651 storyId = _ref6.storyId,
652 rest = _objectWithoutProperties(_ref6, _excluded2);
653
654 var _getEventMetadata5 = (0, _events.getEventMetadata)(this, fullAPI),
655 ref = _getEventMetadata5.ref;
656
657 if (!ref) {
658 fullAPI.selectStory(storyId || kind, story, rest);
659 } else {
660 fullAPI.selectStory(storyId || kind, story, Object.assign({}, rest, {
661 ref: ref.id
662 }));
663 }
664 });
665 fullAPI.on(_coreEvents.STORY_ARGS_UPDATED, function handleStoryArgsUpdated(_ref7) {
666 var storyId = _ref7.storyId,
667 args = _ref7.args;
668
669 var _getEventMetadata6 = (0, _events.getEventMetadata)(this, fullAPI),
670 ref = _getEventMetadata6.ref;
671
672 fullAPI.updateStory(storyId, {
673 args: args
674 }, ref);
675 });
676 fullAPI.on(_coreEvents.CONFIG_ERROR, function handleConfigError(err) {
677 store.setState({
678 storiesConfigured: true,
679 storiesFailed: err
680 });
681 });
682
683 if (!(FEATURES !== null && FEATURES !== void 0 && FEATURES.storyStoreV7)) {
684 _context5.next = 11;
685 break;
686 }
687
688 (_provider$serverChann = provider.serverChannel) === null || _provider$serverChann === void 0 ? void 0 : _provider$serverChann.on(_coreEvents.STORY_INDEX_INVALIDATED, function () {
689 return fullAPI.fetchStoryList();
690 });
691 _context5.next = 11;
692 return fullAPI.fetchStoryList();
693
694 case 11:
695 case "end":
696 return _context5.stop();
697 }
698 }
699 }, _callee5);
700 }));
701
702 return function initModule() {
703 return _ref3.apply(this, arguments);
704 };
705 }();
706
707 return {
708 api: api,
709 state: {
710 storiesHash: {},
711 storyId: initialStoryId,
712 viewMode: initialViewMode,
713 storiesConfigured: false,
714 hasCalledSetOptions: false
715 },
716 init: initModule
717 };
718};
719
720exports.init = init;
\No newline at end of file