diff --git a/.babelrc b/.babelrc index 7db5a2e..f7500e6 100644 --- a/.babelrc +++ b/.babelrc @@ -4,7 +4,10 @@ "stage-3" ], "plugins": [ - "transform-class-properties", - "transform-es2015-modules-umd" + ["transform-es2015-modules-umd", { + "globals": { + "nymph-client": "NymphClient" + } + }] ] } diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..5841d46 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "extends": "semistandard", + "parser": "babel-eslint", + + "plugins": [ + "html" + ], + + "settings": { + "html/indent": "+2" + } +} diff --git a/.gitignore b/.gitignore index 3c3629e..8f028e4 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -node_modules +/node_modules/ +/lib/ diff --git a/lib/QueryEditor.js b/lib/QueryEditor.js deleted file mode 100644 index 4b998d1..0000000 --- a/lib/QueryEditor.js +++ /dev/null @@ -1,1593 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(['exports', './SelectorEditor.html', './ValueEditor.html'], factory); - } else if (typeof exports !== "undefined") { - factory(exports, require('./SelectorEditor.html'), require('./ValueEditor.html')); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.SelectorEditor, global.ValueEditor); - global.QueryEditor = mod.exports; - } -})(this, function (exports, _SelectorEditor, _ValueEditor) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _SelectorEditor2 = _interopRequireDefault(_SelectorEditor); - - var _ValueEditor2 = _interopRequireDefault(_ValueEditor); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; - } - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - function _toConsumableArray(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } else { - return Array.from(arr); - } - } - - function remainingOptions(options, supportedOptions) { - return Object.keys(supportedOptions).filter(function (i) { - return !options.hasOwnProperty(i); - }); - } - - function optionsKeysTypes(options, supportedOptions) { - return Object.keys(options).map(function (key) { - return { key: key, type: supportedOptions[key] }; - }); - } - - function queryText(options, selectors) { - var json = JSON.stringify([options].concat(_toConsumableArray(selectors)), null, 2); - var regex = /\[\s*([^\[\]]*)(?:[\t\n]+|\s{2,})([^\[\]]*)\s*\]/g; - var regex2 = /\[\s*([^\[\]]*[^\[\]\s])\s+\]/g; - while (json.match(regex)) { - json = json.replace(regex, "[$1 $2]"); - } - while (json.match(regex2)) { - json = json.replace(regex2, "[$1]"); - } - return "Nymph.getEntities(" + json.slice(1, -1) + ")"; - } - - function data() { - return { - __newOption: "", - __showHelpDialog: false, - supportedClasses: [], - supportedOptions: { - "class": "class", - "limit": "int", - "offset": "int", - "reverse": "boolean", - "sort": ["cdate", "mdate", "guid"], - "skip_ac": "boolean" - }, - options: {}, - selectors: [], - showQuery: false, - classCheckbox: '', - classInput: '', - classSelect: '', - classAddButton: '', - classRemoveButton: '', - classButton: '' - }; - }; - - var methods = { - addOption: function addOption() { - var options = this.get("options"); - var newOption = this.get("__newOption"); - var supportedOptions = this.get("supportedOptions"); - - if (newOption === "") { - return; - } - - if (!(newOption in options)) { - options[newOption] = this.getDefaultValue(supportedOptions[newOption]); - } - - this.set({ - options: options, - __newOption: "" - }); - }, - removeOption: function removeOption(option) { - var options = this.get("options"); - delete options[option]; - this.set({ options: options }); - }, - getDefaultValue: function getDefaultValue(type) { - switch (type) { - case "class": - var classes = this.get("supportedClasses"); - return classes.length ? classes[0].class : ''; - case "int": - return 0; - case "float": - return 0.0; - case "boolean": - return true; - case "string": - return ""; - case "date": - return Date.now(); - default: - if (Array.isArray(type)) { - return type[0]; - } - return ""; - } - }, - addSelector: function addSelector() { - var selectors = this.get("selectors"); - selectors.push({ type: '&' }); - this.set({ selectors: selectors }); - }, - removeSelector: function removeSelector(index) { - var selectors = this.get("selectors"); - this.set({ selectors: [] }); - - selectors.splice(index, 1); - this.set({ selectors: selectors }); - }, - openHelpDialog: function openHelpDialog() { - this.set({ __showHelp: true }); - }, - closeHelpDialog: function closeHelpDialog() { - this.set({ __showHelp: false }); - } - }; - - function encapsulateStyles(node) { - setAttribute(node, "svelte-3932320288", ""); - } - - function add_css() { - var style = createElement("style"); - style.id = 'svelte-3932320288-style'; - style.textContent = "[svelte-3932320288].query-editor,[svelte-3932320288] .query-editor{font-family:monospace}[svelte-3932320288].options-editor,[svelte-3932320288] .options-editor,[svelte-3932320288].selector-editor,[svelte-3932320288] .selector-editor,[svelte-3932320288].selector-editor .selector,[svelte-3932320288] .selector-editor .selector{padding-left:1em;display:flex;flex-direction:column}[svelte-3932320288].options-editor .option,[svelte-3932320288] .options-editor .option,[svelte-3932320288].selector-editor .selector .clause,[svelte-3932320288] .selector-editor .selector .clause{padding:.5em 1em;display:flex;flex-direction:row}[svelte-3932320288].query-result,[svelte-3932320288] .query-result{border:1px solid}[svelte-3932320288].query-result .query,[svelte-3932320288] .query-result .query{font-family:monospace;margin:0;padding:1em;overflow:auto;max-height:200px}[svelte-3932320288].help-dialog-container,[svelte-3932320288] .help-dialog-container{display:flex;justify-content:center;align-items:center;position:fixed;top:0;left:0;bottom:0;right:0;z-index:1000}[svelte-3932320288].help-dialog-overlay,[svelte-3932320288] .help-dialog-overlay{position:absolute;top:0;left:0;bottom:0;right:0;background-color:rgba(0, 0, 0, 0.3);z-index:1}[svelte-3932320288].help-dialog,[svelte-3932320288] .help-dialog{display:flex;flex-direction:column;box-shadow:0px 5px 36px 0px rgba(0,0,0,0.25);background-color:#fff;padding:2em;max-height:80vh;max-width:80vw;overflow:auto;z-index:2}[svelte-3932320288].help-dialog > *,[svelte-3932320288] .help-dialog > *{margin-bottom:1em}[svelte-3932320288].help-dialog > *:last-child,[svelte-3932320288] .help-dialog > *:last-child{margin-bottom:0}[svelte-3932320288].help-dialog .actions,[svelte-3932320288] .help-dialog .actions{display:flex;flex-direction:row;justify-content:flex-end;align-items:center}[svelte-3932320288].help-dialog .actions > *,[svelte-3932320288] .help-dialog .actions > *{margin-left:1em}"; - appendNode(style, document.head); - } - - function create_main_fragment(state, component) { - var div, h2, text, button, text_2, h3, text_4, div_1, text_5, pre, text_7, text_8, pre_1, text_11, h3_1, text_13, div_2, div_3, button_1, text_16, text_18, div_4, label, input, text_19, text_21, text_22; - - function click_handler(event) { - component.openHelpDialog(); - } - - var if_block = state.remainingOptions.length && create_if_block(state, component); - - var optionsKeysTypes_1 = state.optionsKeysTypes; - - var each_blocks = []; - - for (var i = 0; i < optionsKeysTypes_1.length; i += 1) { - each_blocks[i] = create_each_block_1(state, optionsKeysTypes_1, optionsKeysTypes_1[i], i, component); - } - - function click_handler_1(event) { - component.addSelector(); - } - - var selectors = state.selectors; - - var each_1_blocks = []; - - for (var i = 0; i < selectors.length; i += 1) { - each_1_blocks[i] = create_each_block_4(state, selectors, selectors[i], i, component); - } - - function input_change_handler() { - component.set({ showQuery: input.checked }); - } - - var if_block_1 = state.showQuery && create_if_block_4(state, component); - - var if_block_2 = state.__showHelp && create_if_block_5(state, component); - - return { - c: function create() { - div = createElement("div"); - h2 = createElement("h2"); - text = createText("Query Editor "); - button = createElement("button"); - button.textContent = "Help"; - text_2 = createText("\n "); - h3 = createElement("h3"); - h3.textContent = "Options"; - text_4 = createText("\n "); - div_1 = createElement("div"); - if (if_block) if_block.c(); - text_5 = createText("\n "); - pre = createElement("pre"); - pre.textContent = "{"; - text_7 = createText("\n "); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - text_8 = createText("\n "); - pre_1 = createElement("pre"); - pre_1.textContent = "}"; - text_11 = createText("\n "); - h3_1 = createElement("h3"); - h3_1.textContent = "Selectors"; - text_13 = createText("\n "); - div_2 = createElement("div"); - div_3 = createElement("div"); - button_1 = createElement("button"); - button_1.textContent = "Add Selector"; - text_16 = createText("\n "); - - for (var i = 0; i < each_1_blocks.length; i += 1) { - each_1_blocks[i].c(); - } - - text_18 = createText("\n "); - div_4 = createElement("div"); - label = createElement("label"); - input = createElement("input"); - text_19 = createText("Show Query Preview"); - text_21 = createText("\n "); - if (if_block_1) if_block_1.c(); - text_22 = createText("\n "); - if (if_block_2) if_block_2.c(); - this.h(); - }, - - h: function hydrate() { - encapsulateStyles(div); - button.className = state.classButton; - addListener(button, "click", click_handler); - div_1.className = "options-editor"; - button_1.className = state.classAddButton; - addListener(button_1, "click", click_handler_1); - div_2.className = "selector-editor"; - addListener(input, "change", input_change_handler); - input.className = state.classCheckbox; - input.type = "checkbox"; - div.className = "query-editor"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(h2, div); - appendNode(text, h2); - appendNode(button, h2); - appendNode(text_2, div); - appendNode(h3, div); - appendNode(text_4, div); - appendNode(div_1, div); - if (if_block) if_block.m(div_1, null); - appendNode(text_5, div_1); - appendNode(pre, div_1); - appendNode(text_7, div_1); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div_1, null); - } - - appendNode(text_8, div_1); - appendNode(pre_1, div_1); - appendNode(text_11, div); - appendNode(h3_1, div); - appendNode(text_13, div); - appendNode(div_2, div); - appendNode(div_3, div_2); - appendNode(button_1, div_3); - appendNode(text_16, div_2); - - for (var i = 0; i < each_1_blocks.length; i += 1) { - each_1_blocks[i].m(div_2, null); - } - - appendNode(text_18, div); - appendNode(div_4, div); - appendNode(label, div_4); - appendNode(input, label); - - input.checked = state.showQuery; - - appendNode(text_19, label); - appendNode(text_21, div); - if (if_block_1) if_block_1.m(div, null); - appendNode(text_22, div); - if (if_block_2) if_block_2.m(div, null); - }, - - p: function update(changed, state) { - if (changed.classButton) { - button.className = state.classButton; - } - - if (state.remainingOptions.length) { - if (if_block) { - if_block.p(changed, state); - } else { - if_block = create_if_block(state, component); - if_block.c(); - if_block.m(div_1, text_5); - } - } else if (if_block) { - if_block.u(); - if_block.d(); - if_block = null; - } - - var optionsKeysTypes_1 = state.optionsKeysTypes; - - if (changed.optionsKeysTypes || changed.classSelect || changed.options || changed.supportedClasses || changed.classCheckbox || changed.classInput || changed.classRemoveButton) { - for (var i = 0; i < optionsKeysTypes_1.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, optionsKeysTypes_1, optionsKeysTypes_1[i], i); - } else { - each_blocks[i] = create_each_block_1(state, optionsKeysTypes_1, optionsKeysTypes_1[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(div_1, text_8); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = optionsKeysTypes_1.length; - } - - if (changed.classAddButton) { - button_1.className = state.classAddButton; - } - - var selectors = state.selectors; - - if (changed.selectors || changed.classCheckbox || changed.classInput || changed.classSelect || changed.classAddButton || changed.classRemoveButton) { - for (var i = 0; i < selectors.length; i += 1) { - if (each_1_blocks[i]) { - each_1_blocks[i].p(changed, state, selectors, selectors[i], i); - } else { - each_1_blocks[i] = create_each_block_4(state, selectors, selectors[i], i, component); - each_1_blocks[i].c(); - each_1_blocks[i].m(div_2, null); - } - } - - for (; i < each_1_blocks.length; i += 1) { - each_1_blocks[i].u(); - each_1_blocks[i].d(); - } - each_1_blocks.length = selectors.length; - } - - input.checked = state.showQuery; - if (changed.classCheckbox) { - input.className = state.classCheckbox; - } - - if (state.showQuery) { - if (if_block_1) { - if_block_1.p(changed, state); - } else { - if_block_1 = create_if_block_4(state, component); - if_block_1.c(); - if_block_1.m(div, text_22); - } - } else if (if_block_1) { - if_block_1.u(); - if_block_1.d(); - if_block_1 = null; - } - - if (state.__showHelp) { - if (if_block_2) { - if_block_2.p(changed, state); - } else { - if_block_2 = create_if_block_5(state, component); - if_block_2.c(); - if_block_2.m(div, null); - } - } else if (if_block_2) { - if_block_2.u(); - if_block_2.d(); - if_block_2 = null; - } - }, - - u: function unmount() { - detachNode(div); - if (if_block) if_block.u(); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - - for (var i = 0; i < each_1_blocks.length; i += 1) { - each_1_blocks[i].u(); - } - - if (if_block_1) if_block_1.u(); - if (if_block_2) if_block_2.u(); - }, - - d: function destroy() { - removeListener(button, "click", click_handler); - if (if_block) if_block.d(); - - destroyEach(each_blocks); - - removeListener(button_1, "click", click_handler_1); - - destroyEach(each_1_blocks); - - removeListener(input, "change", input_change_handler); - if (if_block_1) if_block_1.d(); - if (if_block_2) if_block_2.d(); - } - }; - } - - // (12:10) {{#each remainingOptions as option}} - function create_each_block(state, remainingOptions_1, option_1, option_index, component) { - var option, - text_value = option_1, - text, - option_value_value; - - return { - c: function create() { - option = createElement("option"); - text = createText(text_value); - this.h(); - }, - - h: function hydrate() { - option.__value = option_value_value = option_1; - option.value = option.__value; - }, - - m: function mount(target, anchor) { - insertNode(option, target, anchor); - appendNode(text, option); - }, - - p: function update(changed, state, remainingOptions_1, option_1, option_index) { - if (changed.remainingOptions && text_value !== (text_value = option_1)) { - text.data = text_value; - } - - if (changed.remainingOptions && option_value_value !== (option_value_value = option_1)) { - option.__value = option_value_value; - } - - option.value = option.__value; - }, - - u: function unmount() { - detachNode(option); - }, - - d: noop - }; - } - - // (5:4) {{#if remainingOptions.length}} - function create_if_block(state, component) { - var div, - text, - select, - option, - text_1, - select_updating = false; - - var remainingOptions_1 = state.remainingOptions; - - var each_blocks = []; - - for (var i = 0; i < remainingOptions_1.length; i += 1) { - each_blocks[i] = create_each_block(state, remainingOptions_1, remainingOptions_1[i], i, component); - } - - function select_change_handler() { - select_updating = true; - component.set({ __newOption: selectValue(select) }); - select_updating = false; - } - - function change_handler(event) { - component.addOption(); - } - - return { - c: function create() { - div = createElement("div"); - text = createText("Add Option:\n "); - select = createElement("select"); - option = createElement("option"); - text_1 = createText("- Select an Option -"); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - this.h(); - }, - - h: function hydrate() { - option.selected = true; - option.__value = ''; - option.value = option.__value; - addListener(select, "change", select_change_handler); - if (!('__newOption' in state)) component.root._beforecreate.push(select_change_handler); - select.className = state.classSelect; - addListener(select, "change", change_handler); - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(text, div); - appendNode(select, div); - appendNode(option, select); - appendNode(text_1, option); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(select, null); - } - - selectOption(select, state.__newOption); - }, - - p: function update(changed, state) { - var remainingOptions_1 = state.remainingOptions; - - if (changed.remainingOptions) { - for (var i = 0; i < remainingOptions_1.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, remainingOptions_1, remainingOptions_1[i], i); - } else { - each_blocks[i] = create_each_block(state, remainingOptions_1, remainingOptions_1[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(select, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = remainingOptions_1.length; - } - - if (!select_updating) selectOption(select, state.__newOption); - if (changed.classSelect) { - select.className = state.classSelect; - } - }, - - u: function unmount() { - detachNode(div); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - }, - - d: function destroy() { - destroyEach(each_blocks); - - removeListener(select, "change", select_change_handler); - removeListener(select, "change", change_handler); - } - }; - } - - // (21:4) {{#each optionsKeysTypes as option}} - function create_each_block_1(state, optionsKeysTypes_1, option, option_index, component) { - var div, - div_1, - text_value = option.key, - text, - text_1, - text_2, - div_2, - text_4, - div_3, - button; - - var current_block_type = select_block_type(state, optionsKeysTypes_1, option, option_index); - var if_block = current_block_type(state, optionsKeysTypes_1, option, option_index, component); - - return { - c: function create() { - div = createElement("div"); - div_1 = createElement("div"); - text = createText(text_value); - text_1 = createText(":"); - text_2 = createText("\n "); - div_2 = createElement("div"); - if_block.c(); - text_4 = createText("\n "); - div_3 = createElement("div"); - button = createElement("button"); - button.textContent = "Remove"; - this.h(); - }, - - h: function hydrate() { - div_1.className = "name"; - div_2.className = "value"; - button.className = state.classRemoveButton; - addListener(button, "click", click_handler); - - button._svelte = { - component: component, - optionsKeysTypes_1: optionsKeysTypes_1, - option_index: option_index - }; - - div_3.className = "remove"; - div.className = "option"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(div_1, div); - appendNode(text, div_1); - appendNode(text_1, div_1); - appendNode(text_2, div); - appendNode(div_2, div); - if_block.m(div_2, null); - appendNode(text_4, div); - appendNode(div_3, div); - appendNode(button, div_3); - }, - - p: function update(changed, state, optionsKeysTypes_1, option, option_index) { - if (changed.optionsKeysTypes && text_value !== (text_value = option.key)) { - text.data = text_value; - } - - if (current_block_type === (current_block_type = select_block_type(state, optionsKeysTypes_1, option, option_index)) && if_block) { - if_block.p(changed, state, optionsKeysTypes_1, option, option_index); - } else { - if_block.u(); - if_block.d(); - if_block = current_block_type(state, optionsKeysTypes_1, option, option_index, component); - if_block.c(); - if_block.m(div_2, null); - } - - if (changed.classRemoveButton) { - button.className = state.classRemoveButton; - } - - button._svelte.optionsKeysTypes_1 = optionsKeysTypes_1; - button._svelte.option_index = option_index; - }, - - u: function unmount() { - detachNode(div); - if_block.u(); - }, - - d: function destroy() { - if_block.d(); - removeListener(button, "click", click_handler); - } - }; - } - - // (29:14) {{#each supportedClasses as curClass}} - function create_each_block_2(state, optionsKeysTypes_1, option, option_index, supportedClasses, curClass, curClass_index, component) { - var option_1, - text_value = curClass.class, - text, - option_1_value_value; - - return { - c: function create() { - option_1 = createElement("option"); - text = createText(text_value); - this.h(); - }, - - h: function hydrate() { - option_1.__value = option_1_value_value = curClass.class; - option_1.value = option_1.__value; - }, - - m: function mount(target, anchor) { - insertNode(option_1, target, anchor); - appendNode(text, option_1); - }, - - p: function update(changed, state, optionsKeysTypes_1, option, option_index, supportedClasses, curClass, curClass_index) { - if (changed.supportedClasses && text_value !== (text_value = curClass.class)) { - text.data = text_value; - } - - if (changed.supportedClasses && option_1_value_value !== (option_1_value_value = curClass.class)) { - option_1.__value = option_1_value_value; - } - - option_1.value = option_1.__value; - }, - - u: function unmount() { - detachNode(option_1); - }, - - d: noop - }; - } - - // (45:14) {{#each option.type as enumVal}} - function create_each_block_3(state, optionsKeysTypes_1, option, option_index, type, enumVal, enumVal_index, component) { - var option_1, - text_value = enumVal, - text, - option_1_value_value; - - return { - c: function create() { - option_1 = createElement("option"); - text = createText(text_value); - this.h(); - }, - - h: function hydrate() { - option_1.__value = option_1_value_value = enumVal; - option_1.value = option_1.__value; - }, - - m: function mount(target, anchor) { - insertNode(option_1, target, anchor); - appendNode(text, option_1); - }, - - p: function update(changed, state, optionsKeysTypes_1, option, option_index, type, enumVal, enumVal_index) { - if (changed.optionsKeysTypes && text_value !== (text_value = enumVal)) { - text.data = text_value; - } - - if (changed.optionsKeysTypes && option_1_value_value !== (option_1_value_value = enumVal)) { - option_1.__value = option_1_value_value; - } - - option_1.value = option_1.__value; - }, - - u: function unmount() { - detachNode(option_1); - }, - - d: noop - }; - } - - // (27:10) {{#if option.type === "class"}} - function create_if_block_1(state, optionsKeysTypes_1, option, option_index, component) { - var select, - select_updating = false; - - var supportedClasses = state.supportedClasses; - - var each_blocks = []; - - for (var i = 0; i < supportedClasses.length; i += 1) { - each_blocks[i] = create_each_block_2(state, optionsKeysTypes_1, option, option_index, supportedClasses, supportedClasses[i], i, component); - } - - function select_change_handler() { - var state = component.get(); - select_updating = true; - state.options[option.key] = selectValue(select); - component.set({ options: state.options }); - select_updating = false; - } - - return { - c: function create() { - select = createElement("select"); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - this.h(); - }, - - h: function hydrate() { - addListener(select, "change", select_change_handler); - if (!('options' in state)) component.root._beforecreate.push(select_change_handler); - select.className = state.classSelect; - - select._svelte = { - optionsKeysTypes_1: optionsKeysTypes_1, - option_index: option_index - }; - }, - - m: function mount(target, anchor) { - insertNode(select, target, anchor); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(select, null); - } - - selectOption(select, state.options[option.key]); - }, - - p: function update(changed, state, optionsKeysTypes_1, option, option_index) { - var supportedClasses = state.supportedClasses; - - if (changed.supportedClasses) { - for (var i = 0; i < supportedClasses.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, optionsKeysTypes_1, option, option_index, supportedClasses, supportedClasses[i], i); - } else { - each_blocks[i] = create_each_block_2(state, optionsKeysTypes_1, option, option_index, supportedClasses, supportedClasses[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(select, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = supportedClasses.length; - } - - if (!select_updating) selectOption(select, state.options[option.key]); - if (changed.classSelect) { - select.className = state.classSelect; - } - - select._svelte.optionsKeysTypes_1 = optionsKeysTypes_1; - select._svelte.option_index = option_index; - }, - - u: function unmount() { - detachNode(select); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - }, - - d: function destroy() { - destroyEach(each_blocks); - - removeListener(select, "change", select_change_handler); - } - }; - } - - // (35:99) - function create_if_block_2(state, optionsKeysTypes_1, option, option_index, component) { - var valueeditor_updating = {}; - - var valueeditor_initial_data = { - valueTypeInitial: option.type, - allowedTypes: [option.type], - classCheckbox: state.classCheckbox, - classInput: state.classInput, - classSelect: state.classSelect - }; - if (option.key in state.options) { - valueeditor_initial_data.value = state.options[option.key]; - valueeditor_updating.value = true; - } - var valueeditor = new _ValueEditor2.default({ - root: component.root, - data: valueeditor_initial_data, - _bind: function _bind(changed, childState) { - var state = component.get(), - newState = {}; - if (!valueeditor_updating.value && changed.value) { - state.options[option.key] = childState.value; - newState.options = state.options; - newState.optionsKeysTypes = state.optionsKeysTypes; - } - valueeditor_updating = assign({}, changed); - component._set(newState); - valueeditor_updating = {}; - } - }); - - component.root._beforecreate.push(function () { - var state = component.get(), - childState = valueeditor.get(), - newState = {}; - if (!childState) return; - if (!valueeditor_updating.value) { - state.options[option.key] = childState.value; - newState.options = state.options; - newState.optionsKeysTypes = state.optionsKeysTypes; - } - valueeditor_updating = { value: true }; - component._set(newState); - valueeditor_updating = {}; - }); - - var valueeditor_context = { - state: state, - optionsKeysTypes_1: optionsKeysTypes_1, - option_index: option_index - }; - - return { - c: function create() { - valueeditor._fragment.c(); - }, - - m: function mount(target, anchor) { - valueeditor._mount(target, anchor); - }, - - p: function update(changed, state, optionsKeysTypes_1, option, option_index) { - var valueeditor_changes = {}; - if (changed.optionsKeysTypes) valueeditor_changes.valueTypeInitial = option.type; - if (changed.optionsKeysTypes) valueeditor_changes.allowedTypes = [option.type]; - if (changed.classCheckbox) valueeditor_changes.classCheckbox = state.classCheckbox; - if (changed.classInput) valueeditor_changes.classInput = state.classInput; - if (changed.classSelect) valueeditor_changes.classSelect = state.classSelect; - if (!valueeditor_updating.value && changed.options || changed.optionsKeysTypes) { - valueeditor_changes.value = state.options[option.key]; - valueeditor_updating.value = true; - } - valueeditor._set(valueeditor_changes); - valueeditor_updating = {}; - - valueeditor_context.state = state; - valueeditor_context.optionsKeysTypes_1 = optionsKeysTypes_1; - valueeditor_context.option_index = option_index; - }, - - u: function unmount() { - valueeditor._unmount(); - }, - - d: function destroy() { - valueeditor.destroy(false); - } - }; - } - - // (43:10) {{else}} - function create_if_block_3(state, optionsKeysTypes_1, option, option_index, component) { - var select, - select_updating = false; - - var type = option.type; - - var each_blocks = []; - - for (var i = 0; i < type.length; i += 1) { - each_blocks[i] = create_each_block_3(state, optionsKeysTypes_1, option, option_index, type, type[i], i, component); - } - - function select_change_handler() { - var state = component.get(); - select_updating = true; - state.options[option.key] = selectValue(select); - component.set({ options: state.options }); - select_updating = false; - } - - return { - c: function create() { - select = createElement("select"); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - this.h(); - }, - - h: function hydrate() { - addListener(select, "change", select_change_handler); - if (!('options' in state)) component.root._beforecreate.push(select_change_handler); - select.className = state.classSelect; - - select._svelte = { - optionsKeysTypes_1: optionsKeysTypes_1, - option_index: option_index - }; - }, - - m: function mount(target, anchor) { - insertNode(select, target, anchor); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(select, null); - } - - selectOption(select, state.options[option.key]); - }, - - p: function update(changed, state, optionsKeysTypes_1, option, option_index) { - var type = option.type; - - if (changed.optionsKeysTypes) { - for (var i = 0; i < type.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, optionsKeysTypes_1, option, option_index, type, type[i], i); - } else { - each_blocks[i] = create_each_block_3(state, optionsKeysTypes_1, option, option_index, type, type[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(select, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = type.length; - } - - if (!select_updating) selectOption(select, state.options[option.key]); - if (changed.classSelect) { - select.className = state.classSelect; - } - - select._svelte.optionsKeysTypes_1 = optionsKeysTypes_1; - select._svelte.option_index = option_index; - }, - - u: function unmount() { - detachNode(select); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - }, - - d: function destroy() { - destroyEach(each_blocks); - - removeListener(select, "change", select_change_handler); - } - }; - } - - // (65:4) {{#each selectors as selector, index}} - function create_each_block_4(state, selectors, selector, index, component) { - var selectoreditor_updating = {}; - - var selectoreditor_initial_data = { - classCheckbox: state.classCheckbox, - classInput: state.classInput, - classSelect: state.classSelect, - classAddButton: state.classAddButton, - classRemoveButton: state.classRemoveButton - }; - if (index in selectors) { - selectoreditor_initial_data.selector = selector; - selectoreditor_updating.selector = true; - } - var selectoreditor = new _SelectorEditor2.default({ - root: component.root, - data: selectoreditor_initial_data, - _bind: function _bind(changed, childState) { - var state = component.get(), - newState = {}; - if (!selectoreditor_updating.selector && changed.selector) { - var list = selectoreditor_context.selectors; - var index = selectoreditor_context.index; - list[index] = childState.selector; - - newState.selectors = state.selectors; - } - selectoreditor_updating = assign({}, changed); - component._set(newState); - selectoreditor_updating = {}; - } - }); - - component.root._beforecreate.push(function () { - var state = component.get(), - childState = selectoreditor.get(), - newState = {}; - if (!childState) return; - if (!selectoreditor_updating.selector) { - var list = selectoreditor_context.selectors; - var index = selectoreditor_context.index; - list[index] = childState.selector; - - newState.selectors = state.selectors; - } - selectoreditor_updating = { selector: true }; - component._set(newState); - selectoreditor_updating = {}; - }); - - selectoreditor.on("remove", function (event) { - var selectors = selectoreditor_context.selectors, - index = selectoreditor_context.index, - selector = selectors[index]; - - component.removeSelector(index); - }); - - var selectoreditor_context = { - selectors: selectors, - index: index - }; - - return { - c: function create() { - selectoreditor._fragment.c(); - }, - - m: function mount(target, anchor) { - selectoreditor._mount(target, anchor); - }, - - p: function update(changed, state, selectors, selector, index) { - var selectoreditor_changes = {}; - if (changed.classCheckbox) selectoreditor_changes.classCheckbox = state.classCheckbox; - if (changed.classInput) selectoreditor_changes.classInput = state.classInput; - if (changed.classSelect) selectoreditor_changes.classSelect = state.classSelect; - if (changed.classAddButton) selectoreditor_changes.classAddButton = state.classAddButton; - if (changed.classRemoveButton) selectoreditor_changes.classRemoveButton = state.classRemoveButton; - if (!selectoreditor_updating.selector && changed.selectors) { - selectoreditor_changes.selector = selector; - selectoreditor_updating.selector = true; - } - selectoreditor._set(selectoreditor_changes); - selectoreditor_updating = {}; - - selectoreditor_context.selectors = selectors; - selectoreditor_context.index = index; - }, - - u: function unmount() { - selectoreditor._unmount(); - }, - - d: function destroy() { - selectoreditor.destroy(false); - } - }; - } - - // (79:2) {{#if showQuery}} - function create_if_block_4(state, component) { - var h3, text_1, div, pre, text_2; - - return { - c: function create() { - h3 = createElement("h3"); - h3.textContent = "Query"; - text_1 = createText("\n "); - div = createElement("div"); - pre = createElement("pre"); - text_2 = createText(state.queryText); - this.h(); - }, - - h: function hydrate() { - pre.className = "query"; - div.className = "query-result"; - }, - - m: function mount(target, anchor) { - insertNode(h3, target, anchor); - insertNode(text_1, target, anchor); - insertNode(div, target, anchor); - appendNode(pre, div); - appendNode(text_2, pre); - }, - - p: function update(changed, state) { - if (changed.queryText) { - text_2.data = state.queryText; - } - }, - - u: function unmount() { - detachNode(h3); - detachNode(text_1); - detachNode(div); - }, - - d: noop - }; - } - - // (85:2) {{#if __showHelp}} - function create_if_block_5(state, component) { - var div, div_1, text, div_2, h3, text_2, div_3, text_11, div_4, text_13, div_5, text_20, div_6, text_40, div_7, text_42, div_8, text_55, div_9, button; - - function click_handler_1(event) { - component.closeHelpDialog(); - } - - function click_handler_2(event) { - component.closeHelpDialog(); - } - - return { - c: function create() { - div = createElement("div"); - div_1 = createElement("div"); - text = createText("\n "); - div_2 = createElement("div"); - h3 = createElement("h3"); - h3.textContent = "How to Build Nymph Queries"; - text_2 = createText("\n\n "); - div_3 = createElement("div"); - div_3.innerHTML = "options is an associative array, which contains any of the following\n settings (in the form options['name'] = value):\n\n
Nymph.getEntities(\n {\n 'reverse': true,\n 'limit': 2\n },\n {\n 'type': '&', // all must be true\n 'tag': 'person',\n 'isset': 'spouse',\n 'equal': [\n ['gender', 'male'],\n ['lname', 'Smith']\n ],\n '!strict': ['warnings', 0]\n },\n {\n 'type': '|', // at least one of the selectors in this must evaluate to true\n '1': {\n 'type': '&',\n 'tag': ['level1', 'level2']\n },\n '2': {\n 'type': '&',\n 'tag': ['access1', 'access2']\n }\n },\n {\n 'type': '|', // at least one must be true\n 'tag': ['employee', 'manager']\n },\n {\n 'type': '|',\n 'equal': [\n ['name', 'Clark'],\n ['name', 'James']\n ],\n 'pmatch': [\n ['name', 'Chris(topher)?'],\n ['name', 'Ja(ke|cob)']\n ]\n },\n {\n 'type': '!|', // at least one must be false\n 'gte': ['age', 22],\n 'gt': ['pay', 8]\n }\n);"; - text_55 = createText("\n\n "); - div_9 = createElement("div"); - button = createElement("button"); - button.textContent = "Close"; - this.h(); - }, - - h: function hydrate() { - div_1.className = "help-dialog-overlay"; - addListener(div_1, "click", click_handler_1); - button.className = state.classButton; - addListener(button, "click", click_handler_2); - div_9.className = "actions"; - div_2.className = "help-dialog"; - div.className = "help-dialog-container"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(div_1, div); - appendNode(text, div); - appendNode(div_2, div); - appendNode(h3, div_2); - appendNode(text_2, div_2); - appendNode(div_3, div_2); - appendNode(text_11, div_2); - appendNode(div_4, div_2); - appendNode(text_13, div_2); - appendNode(div_5, div_2); - appendNode(text_20, div_2); - appendNode(div_6, div_2); - appendNode(text_40, div_2); - appendNode(div_7, div_2); - appendNode(text_42, div_2); - appendNode(div_8, div_2); - appendNode(text_55, div_2); - appendNode(div_9, div_2); - appendNode(button, div_9); - }, - - p: function update(changed, state) { - if (changed.classButton) { - button.className = state.classButton; - } - }, - - u: function unmount() { - detachNode(div); - }, - - d: function destroy() { - removeListener(div_1, "click", click_handler_1); - removeListener(button, "click", click_handler_2); - } - }; - } - - function select_block_type(state, optionsKeysTypes_1, option, option_index) { - if (option.type === "class") return create_if_block_1; - if (option.type === "int" || option.type === "boolean" || option.type === "string") return create_if_block_2; - return create_if_block_3; - } - - function click_handler(event) { - var component = this._svelte.component; - var optionsKeysTypes_1 = this._svelte.optionsKeysTypes_1, - option_index = this._svelte.option_index, - option = optionsKeysTypes_1[option_index]; - component.removeOption(option.key); - } - - function QueryEditor(options) { - init(this, options); - this._state = assign(data(), options.data); - this._recompute({ options: 1, supportedOptions: 1, selectors: 1 }, this._state); - - if (!document.getElementById("svelte-3932320288-style")) add_css(); - - if (!options.root) { - this._oncreate = []; - this._beforecreate = []; - this._aftercreate = []; - } - - this._fragment = create_main_fragment(this._state, this); - - if (options.target) { - this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); - - this._lock = true; - callAll(this._beforecreate); - callAll(this._oncreate); - callAll(this._aftercreate); - this._lock = false; - } - } - - assign(QueryEditor.prototype, methods, { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, - _set: _set, - _mount: _mount, - _unmount: _unmount - }); - - QueryEditor.prototype._recompute = function _recompute(changed, state) { - if (changed.options || changed.supportedOptions) { - if (differs(state.remainingOptions, state.remainingOptions = remainingOptions(state.options, state.supportedOptions))) changed.remainingOptions = true; - if (differs(state.optionsKeysTypes, state.optionsKeysTypes = optionsKeysTypes(state.options, state.supportedOptions))) changed.optionsKeysTypes = true; - } - - if (changed.options || changed.selectors) { - if (differs(state.queryText, state.queryText = queryText(state.options, state.selectors))) changed.queryText = true; - } - }; - - function setAttribute(node, attribute, value) { - node.setAttribute(attribute, value); - } - - function createElement(name) { - return document.createElement(name); - } - - function appendNode(node, target) { - target.appendChild(node); - } - - function createText(data) { - return document.createTextNode(data); - } - - function addListener(node, event, handler) { - node.addEventListener(event, handler, false); - } - - function insertNode(node, target, anchor) { - target.insertBefore(node, anchor); - } - - function detachNode(node) { - node.parentNode.removeChild(node); - } - - function removeListener(node, event, handler) { - node.removeEventListener(event, handler, false); - } - - function destroyEach(iterations) { - for (var i = 0; i < iterations.length; i += 1) { - if (iterations[i]) iterations[i].d(); - } - } - - function noop() {} - - function selectValue(select) { - var selectedOption = select.querySelector(':checked') || select.options[0]; - return selectedOption && selectedOption.__value; - } - - function selectOption(select, value) { - for (var i = 0; i < select.options.length; i += 1) { - var option = select.options[i]; - - if (option.__value === value) { - option.selected = true; - return; - } - } - } - - function assign(target) { - var k, - source, - i = 1, - len = arguments.length; - for (; i < len; i++) { - source = arguments[i]; - for (k in source) { - target[k] = source[k]; - } - } - - return target; - } - - function init(component, options) { - component._observers = { pre: blankObject(), post: blankObject() }; - component._handlers = blankObject(); - component._bind = options._bind; - - component.options = options; - component.root = options.root || component; - component.store = component.root.store || options.store; - } - - function callAll(fns) { - while (fns && fns.length) { - fns.pop()(); - } - } - - function destroy(detach) { - this.destroy = noop; - this.fire('destroy'); - this.set = this.get = noop; - - if (detach !== false) this._fragment.u(); - this._fragment.d(); - this._fragment = this._state = null; - } - - function get(key) { - return key ? this._state[key] : this._state; - } - - function fire(eventName, data) { - var handlers = eventName in this._handlers && this._handlers[eventName].slice(); - if (!handlers) return; - - for (var i = 0; i < handlers.length; i += 1) { - handlers[i].call(this, data); - } - } - - function observe(key, callback, options) { - var group = options && options.defer ? this._observers.post : this._observers.pre; - - (group[key] || (group[key] = [])).push(callback); - - if (!options || options.init !== false) { - callback.__calling = true; - callback.call(this, this._state[key]); - callback.__calling = false; - } - - return { - cancel: function cancel() { - var index = group[key].indexOf(callback); - if (~index) group[key].splice(index, 1); - } - }; - } - - function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); - handlers.push(handler); - - return { - cancel: function cancel() { - var index = handlers.indexOf(handler); - if (~index) handlers.splice(index, 1); - } - }; - } - - function set(newState) { - this._set(assign({}, newState)); - if (this.root._lock) return; - this.root._lock = true; - callAll(this.root._beforecreate); - callAll(this.root._oncreate); - callAll(this.root._aftercreate); - this.root._lock = false; - } - - function _set(newState) { - var oldState = this._state, - changed = {}, - dirty = false; - - for (var key in newState) { - if (differs(newState[key], oldState[key])) changed[key] = dirty = true; - } - if (!dirty) return; - - this._state = assign({}, oldState, newState); - this._recompute(changed, this._state); - if (this._bind) this._bind(changed, this._state); - - if (this._fragment) { - dispatchObservers(this, this._observers.pre, changed, this._state, oldState); - this._fragment.p(changed, this._state); - dispatchObservers(this, this._observers.post, changed, this._state, oldState); - } - } - - function _mount(target, anchor) { - this._fragment.m(target, anchor); - } - - function _unmount() { - if (this._fragment) this._fragment.u(); - } - - function differs(a, b) { - return a !== b || a && (typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' || typeof a === 'function'; - } - - function blankObject() { - return Object.create(null); - } - - function dispatchObservers(component, group, changed, newState, oldState) { - for (var key in group) { - if (!changed[key]) continue; - - var newValue = newState[key]; - var oldValue = oldState[key]; - - var callbacks = group[key]; - if (!callbacks) continue; - - for (var i = 0; i < callbacks.length; i += 1) { - var callback = callbacks[i]; - if (callback.__calling) continue; - - callback.__calling = true; - callback.call(component, newValue, oldValue); - callback.__calling = false; - } - } - } - exports.default = QueryEditor; -}); diff --git a/lib/SelectorEditor.js b/lib/SelectorEditor.js deleted file mode 100644 index 26dac2e..0000000 --- a/lib/SelectorEditor.js +++ /dev/null @@ -1,2128 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(['exports', './ValueEditor.html'], factory); - } else if (typeof exports !== "undefined") { - factory(exports, require('./ValueEditor.html')); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.ValueEditor); - global.SelectorEditor = mod.exports; - } -})(this, function (exports, _ValueEditor) { - 'use strict'; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _ValueEditor2 = _interopRequireDefault(_ValueEditor); - - function _interopRequireDefault(obj) { - return obj && obj.__esModule ? obj : { - default: obj - }; - } - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value: value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - - return obj; - } - - var _slicedToArray = function () { - function sliceIterator(arr, i) { - var _arr = []; - var _n = true; - var _d = false; - var _e = undefined; - - try { - for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { - _arr.push(_s.value); - - if (i && _arr.length === i) break; - } - } catch (err) { - _d = true; - _e = err; - } finally { - try { - if (!_n && _i["return"]) _i["return"](); - } finally { - if (_d) throw _e; - } - } - - return _arr; - } - - return function (arr, i) { - if (Array.isArray(arr)) { - return arr; - } else if (Symbol.iterator in Object(arr)) { - return sliceIterator(arr, i); - } else { - throw new TypeError("Invalid attempt to destructure non-iterable instance"); - } - }; - }(); - - function _toConsumableArray(arr) { - if (Array.isArray(arr)) { - for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { - arr2[i] = arr[i]; - } - - return arr2; - } else { - return Array.from(arr); - } - } - - function remainingClauses(selector, supportedClauses) { - return Object.keys(supportedClauses).filter(function (i) { - return !selector.hasOwnProperty(i); - }); - } - - function clausesKeysTypes(selector, supportedClauses) { - return Object.keys(selector).filter(function (i) { - return i !== "type"; - }).map(function (key) { - return supportedClauses.hasOwnProperty(key) ? { key: key, type: supportedClauses[key] } : { key: key, type: 'selector' }; - }); - } - - function isCompoundVectorClauseKeys(selector, supportedClauses) { - var entries = Object.entries(selector); - var filtered = entries.filter(function (i) { - return i[0] !== "type" && !i[0].match(/^\d+$/) && supportedClauses[i[0]].vector; - }); - var mapped = filtered.map(function (i) { - i[1] = Array.isArray(i[1][0]);return i; - }); - var map = mapped.length ? Object.assign.apply(Object, _toConsumableArray(mapped.map(function (_ref) { - var _ref2 = _slicedToArray(_ref, 2), - k = _ref2[0], - v = _ref2[1]; - - return _defineProperty({}, k, v); - }))) : {}; - return map; - } - - function isCompoundScalarClauseKeys(selector, supportedClauses) { - var entries = Object.entries(selector); - var filtered = entries.filter(function (i) { - return i[0] !== "type" && !i[0].match(/^\d+$/) && !supportedClauses[i[0]].vector; - }); - var mapped = filtered.map(function (i) { - i[1] = Array.isArray(i[1]);return i; - }); - var map = mapped.length ? Object.assign.apply(Object, _toConsumableArray(mapped.map(function (_ref4) { - var _ref5 = _slicedToArray(_ref4, 2), - k = _ref5[0], - v = _ref5[1]; - - return _defineProperty({}, k, v); - }))) : {}; - return map; - } - - function data() { - return { - __newClause: "", - supportedClauses: { - "guid": { type: "int", vector: false, allowedTypes: ["int"] }, - "!guid": { type: "int", vector: false, allowedTypes: ["int"] }, - "tag": { type: "string", vector: false, allowedTypes: ["string"] }, - "!tag": { type: "string", vector: false, allowedTypes: ["string"] }, - "isset": { type: "string", vector: false, allowedTypes: ["string"] }, - "!isset": { type: "string", vector: false, allowedTypes: ["string"] }, - "equal": { type: null, vector: true, allowedTypes: ["string", "int", "float", "boolean", "date"] }, - "!equal": { type: null, vector: true, allowedTypes: ["string", "int", "float", "boolean", "date"] }, - "strict": { type: null, vector: true, allowedTypes: ["string", "int", "float", "boolean", "date"] }, - "!strict": { type: null, vector: true, allowedTypes: ["string", "int", "float", "boolean", "date"] }, - "array": { type: null, vector: true, allowedTypes: ["string", "int", "float", "boolean", "date"] }, - "!array": { type: null, vector: true, allowedTypes: ["string", "int", "float", "boolean", "date"] }, - "match": { type: "string", vector: true, allowedTypes: ["string"] }, - "!match": { type: "string", vector: true, allowedTypes: ["string"] }, - "pmatch": { type: "string", vector: true, allowedTypes: ["string"] }, - "!pmatch": { type: "string", vector: true, allowedTypes: ["string"] }, - "ipmatch": { type: "string", vector: true, allowedTypes: ["string"] }, - "!ipmatch": { type: "string", vector: true, allowedTypes: ["string"] }, - "like": { type: "string", vector: true, allowedTypes: ["string"] }, - "!like": { type: "string", vector: true, allowedTypes: ["string"] }, - "ilike": { type: "string", vector: true, allowedTypes: ["string"] }, - "!ilike": { type: "string", vector: true, allowedTypes: ["string"] }, - "gt": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "!gt": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "gte": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "!gte": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "lt": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "!lt": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "lte": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "!lte": { type: "float", vector: true, allowedTypes: ["int", "float", "date"] }, - "ref": { type: "int", vector: true, allowedTypes: ["int"] }, - "!ref": { type: "int", vector: true, allowedTypes: ["int"] } - }, - selector: { type: '&' }, - classCheckbox: '', - classInput: '', - classSelect: '', - classAddButton: '', - classRemoveButton: '' - }; - }; - - var methods = { - addClause: function addClause() { - var selector = this.get("selector"); - var newClause = this.get("__newClause"); - var supportedClauses = this.get("supportedClauses"); - - if (newClause === "") { - return; - } - - if (!(newClause in selector)) { - selector[newClause] = this.getDefaultValue(supportedClauses[newClause]); - } - - this.set({ - selector: selector, - __newClause: "" - }); - }, - removeClause: function removeClause(clause) { - var selector = this.get("selector"); - delete selector[clause]; - this.set({ selector: selector }); - }, - addClauseEntry: function addClauseEntry(clause) { - var selector = this.get("selector"); - var supportedClauses = this.get("supportedClauses"); - - if (clause in selector) { - if (supportedClauses[clause].vector && !this.isCompoundVectorClause(selector[clause]) || !supportedClauses[clause].vector && !this.isCompoundScalarClause(selector[clause])) { - var firstEntry = selector[clause]; - selector[clause] = [firstEntry]; - } - - selector[clause].push(this.getDefaultValue(supportedClauses[clause])); - } - - this.set({ selector: selector }); - }, - removeClauseEntry: function removeClauseEntry(clause, index) { - var selector = this.get("selector"); - var supportedClauses = this.get("supportedClauses"); - - if (clause in selector) { - selector[clause].splice(index, 1); - - if (supportedClauses[clause].vector && selector[clause].length === 1 && this.isCompoundVectorClause(selector[clause]) || !supportedClauses[clause].vector && selector[clause].length === 1 && this.isCompoundScalarClause(selector[clause])) { - var firstEntry = selector[clause][0]; - selector[clause] = firstEntry; - } - } - - this.set({ selector: selector }); - }, - makeDate: function makeDate(clauseKey, index) { - var selector = this.get("selector"); - - if (index === null) { - selector[clauseKey][1] = null; - if (selector[clauseKey].length === 2) { - selector[clauseKey].push(""); - } - } else { - selector[clauseKey][index][1] = null; - if (selector[clauseKey][index].length === 2) { - selector[clauseKey][index].push(""); - } - } - - this.set({ selector: selector }); - }, - makeNotDate: function makeNotDate(clauseKey, index) { - var selector = this.get("selector"); - - if (index === null) { - if (selector[clauseKey].length === 3) { - selector[clauseKey].splice(2, 1); - } - } else { - if (selector[clauseKey][index].length === 3) { - selector[clauseKey][index].splice(2, 1); - } - } - - this.set({ selector: selector }); - }, - getDefaultValue: function getDefaultValue(typeObj) { - switch (typeObj.type) { - case "int": - return typeObj.vector ? ["", 1] : 1; - case "float": - return typeObj.vector ? ["", 0.1] : 0.1; - case "boolean": - return typeObj.vector ? ["", true] : true; - case "string": - default: - return typeObj.vector ? ["", ""] : ""; - } - }, - addSelector: function addSelector() { - var selector = this.get("selector"); - - // Find the first number that's not taken. - var i = 1; - while (selector.hasOwnProperty("" + i)) { - i++; - } - selector["" + i] = { "type": "&" }; - - this.set({ selector: selector }); - }, - removeSelector: function removeSelector(key) { - var selector = this.get("selector"); - this.set({ selector: { type: '&' } }); - - // Delete the keyed selector. - delete selector[key]; - // Rearrange all the following selectors. - var i = parseInt(key, 10) + 1; - while (selector.hasOwnProperty("" + i)) { - selector["" + (i - 1)] = selector["" + i]; - delete selector["" + i]; - i++; - } - - this.set({ selector: selector }); - }, - isCompoundVectorClause: function isCompoundVectorClause(value) { - return Array.isArray(value[0]); - }, - isCompoundScalarClause: function isCompoundScalarClause(value) { - return Array.isArray(value); - } - }; - - function encapsulateStyles(node) { - setAttribute(node, "svelte-987364770", ""); - } - - function add_css() { - var style = createElement("style"); - style.id = 'svelte-987364770-style'; - style.textContent = "[svelte-987364770].selector,[svelte-987364770] .selector{margin:.5em;padding:.5em;display:flex;flex-direction:column;border:1px dotted}[svelte-987364770].selector .clause,[svelte-987364770] .selector .clause,[svelte-987364770].selector .clause .clause-entry,[svelte-987364770] .selector .clause .clause-entry{padding:.5em 1em;display:flex;flex-direction:row}"; - appendNode(style, document.head); - } - - function create_main_fragment(state, component) { - var div, - text, - div_1, - div_2, - text_2, - div_3, - select, - option, - text_3, - option_1, - text_4, - option_2, - text_5, - option_3, - text_6, - select_updating = false, - text_9, - text_10; - - var if_block = state.remainingClauses.length && create_if_block(state, component); - - function select_change_handler() { - var state = component.get(); - select_updating = true; - state.selector.type = selectValue(select); - component.set({ selector: state.selector }); - select_updating = false; - } - - var clausesKeysTypes_1 = state.clausesKeysTypes; - - var each_blocks = []; - - for (var i = 0; i < clausesKeysTypes_1.length; i += 1) { - each_blocks[i] = create_each_block_1(state, clausesKeysTypes_1, clausesKeysTypes_1[i], i, component); - } - - return { - c: function create() { - div = createElement("div"); - if (if_block) if_block.c(); - text = createText("\n {\n "); - div_1 = createElement("div"); - div_2 = createElement("div"); - div_2.textContent = "type:"; - text_2 = createText("\n "); - div_3 = createElement("div"); - select = createElement("select"); - option = createElement("option"); - text_3 = createText("& (All clauses in the selector must be true.)"); - option_1 = createElement("option"); - text_4 = createText("| (At least one clause in the selector must be true.)"); - option_2 = createElement("option"); - text_5 = createText("!& (All clauses in the selector must be false.)"); - option_3 = createElement("option"); - text_6 = createText("!| (At least one clause in the selector must be false.)"); - text_9 = createText("\n "); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - text_10 = createText("\n }"); - this.h(); - }, - - h: function hydrate() { - encapsulateStyles(div); - div_2.className = "name"; - option.__value = "&"; - option.value = option.__value; - option_1.__value = "|"; - option_1.value = option_1.__value; - option_2.__value = "!&"; - option_2.value = option_2.__value; - option_3.__value = "!|"; - option_3.value = option_3.__value; - addListener(select, "change", select_change_handler); - if (!('selector' in state)) component.root._beforecreate.push(select_change_handler); - select.className = state.classSelect; - div_3.className = "value"; - div_1.className = "clause"; - div.className = "selector"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - if (if_block) if_block.m(div, null); - appendNode(text, div); - appendNode(div_1, div); - appendNode(div_2, div_1); - appendNode(text_2, div_1); - appendNode(div_3, div_1); - appendNode(select, div_3); - appendNode(option, select); - appendNode(text_3, option); - appendNode(option_1, select); - appendNode(text_4, option_1); - appendNode(option_2, select); - appendNode(text_5, option_2); - appendNode(option_3, select); - appendNode(text_6, option_3); - - selectOption(select, state.selector.type); - - appendNode(text_9, div); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(div, null); - } - - appendNode(text_10, div); - }, - - p: function update(changed, state) { - if (state.remainingClauses.length) { - if (if_block) { - if_block.p(changed, state); - } else { - if_block = create_if_block(state, component); - if_block.c(); - if_block.m(div, text); - } - } else if (if_block) { - if_block.u(); - if_block.d(); - if_block = null; - } - - if (!select_updating) selectOption(select, state.selector.type); - if (changed.classSelect) { - select.className = state.classSelect; - } - - var clausesKeysTypes_1 = state.clausesKeysTypes; - - if (changed.clausesKeysTypes || changed.selector || changed.classCheckbox || changed.classInput || changed.classSelect || changed.classAddButton || changed.classRemoveButton || changed.isCompoundVectorClauseKeys || changed.isCompoundScalarClauseKeys) { - for (var i = 0; i < clausesKeysTypes_1.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, clausesKeysTypes_1, clausesKeysTypes_1[i], i); - } else { - each_blocks[i] = create_each_block_1(state, clausesKeysTypes_1, clausesKeysTypes_1[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(div, text_10); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = clausesKeysTypes_1.length; - } - }, - - u: function unmount() { - detachNode(div); - if (if_block) if_block.u(); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - }, - - d: function destroy() { - if (if_block) if_block.d(); - removeListener(select, "change", select_change_handler); - - destroyEach(each_blocks); - } - }; - } - - // (9:8) {{#each remainingClauses as clause}} - function create_each_block(state, remainingClauses_1, clause, clause_index, component) { - var option, - text_value = clause, - text, - option_value_value; - - return { - c: function create() { - option = createElement("option"); - text = createText(text_value); - this.h(); - }, - - h: function hydrate() { - option.__value = option_value_value = clause; - option.value = option.__value; - }, - - m: function mount(target, anchor) { - insertNode(option, target, anchor); - appendNode(text, option); - }, - - p: function update(changed, state, remainingClauses_1, clause, clause_index) { - if (changed.remainingClauses && text_value !== (text_value = clause)) { - text.data = text_value; - } - - if (changed.remainingClauses && option_value_value !== (option_value_value = clause)) { - option.__value = option_value_value; - } - - option.value = option.__value; - }, - - u: function unmount() { - detachNode(option); - }, - - d: noop - }; - } - - // (2:2) {{#if remainingClauses.length}} - function create_if_block(state, component) { - var div, - text, - select, - option, - text_1, - select_updating = false, - text_2, - button, - text_4, - button_1; - - var remainingClauses_1 = state.remainingClauses; - - var each_blocks = []; - - for (var i = 0; i < remainingClauses_1.length; i += 1) { - each_blocks[i] = create_each_block(state, remainingClauses_1, remainingClauses_1[i], i, component); - } - - function select_change_handler() { - select_updating = true; - component.set({ __newClause: selectValue(select) }); - select_updating = false; - } - - function change_handler(event) { - component.addClause(); - } - - function click_handler(event) { - component.addSelector(); - } - - function click_handler_1(event) { - component.fire('remove'); - } - - return { - c: function create() { - div = createElement("div"); - text = createText("Add Clause:\n "); - select = createElement("select"); - option = createElement("option"); - text_1 = createText("- Select a Clause -"); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - text_2 = createText("\n "); - button = createElement("button"); - button.textContent = "Add Selector Clause"; - text_4 = createText("\n "); - button_1 = createElement("button"); - button_1.textContent = "Remove Selector"; - this.h(); - }, - - h: function hydrate() { - option.selected = true; - option.__value = ''; - option.value = option.__value; - addListener(select, "change", select_change_handler); - if (!('__newClause' in state)) component.root._beforecreate.push(select_change_handler); - select.className = state.classSelect; - addListener(select, "change", change_handler); - button.className = state.classAddButton; - addListener(button, "click", click_handler); - button_1.className = state.classRemoveButton; - addListener(button_1, "click", click_handler_1); - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(text, div); - appendNode(select, div); - appendNode(option, select); - appendNode(text_1, option); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(select, null); - } - - selectOption(select, state.__newClause); - - appendNode(text_2, div); - appendNode(button, div); - appendNode(text_4, div); - appendNode(button_1, div); - }, - - p: function update(changed, state) { - var remainingClauses_1 = state.remainingClauses; - - if (changed.remainingClauses) { - for (var i = 0; i < remainingClauses_1.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, remainingClauses_1, remainingClauses_1[i], i); - } else { - each_blocks[i] = create_each_block(state, remainingClauses_1, remainingClauses_1[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(select, null); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = remainingClauses_1.length; - } - - if (!select_updating) selectOption(select, state.__newClause); - if (changed.classSelect) { - select.className = state.classSelect; - } - - if (changed.classAddButton) { - button.className = state.classAddButton; - } - - if (changed.classRemoveButton) { - button_1.className = state.classRemoveButton; - } - }, - - u: function unmount() { - detachNode(div); - - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - }, - - d: function destroy() { - destroyEach(each_blocks); - - removeListener(select, "change", select_change_handler); - removeListener(select, "change", change_handler); - removeListener(button, "click", click_handler); - removeListener(button_1, "click", click_handler_1); - } - }; - } - - // (41:2) {{#each clausesKeysTypes as clause}} - function create_each_block_1(state, clausesKeysTypes_1, clause, clause_index, component) { - var div, - div_1, - text_value = clause.key, - text, - text_1, - text_2, - div_2, - text_4; - - var current_block_type = select_block_type_2(state, clausesKeysTypes_1, clause, clause_index); - var if_block = current_block_type(state, clausesKeysTypes_1, clause, clause_index, component); - - var if_block_1 = clause.type !== "selector" && create_if_block_8(state, clausesKeysTypes_1, clause, clause_index, component); - - return { - c: function create() { - div = createElement("div"); - div_1 = createElement("div"); - text = createText(text_value); - text_1 = createText(":"); - text_2 = createText("\n "); - div_2 = createElement("div"); - if_block.c(); - text_4 = createText("\n "); - if (if_block_1) if_block_1.c(); - this.h(); - }, - - h: function hydrate() { - div_1.className = "name"; - div_2.className = "value"; - div.className = "clause"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(div_1, div); - appendNode(text, div_1); - appendNode(text_1, div_1); - appendNode(text_2, div); - appendNode(div_2, div); - if_block.m(div_2, null); - appendNode(text_4, div); - if (if_block_1) if_block_1.m(div, null); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - if (changed.clausesKeysTypes && text_value !== (text_value = clause.key)) { - text.data = text_value; - } - - if (current_block_type === (current_block_type = select_block_type_2(state, clausesKeysTypes_1, clause, clause_index)) && if_block) { - if_block.p(changed, state, clausesKeysTypes_1, clause, clause_index); - } else { - if_block.u(); - if_block.d(); - if_block = current_block_type(state, clausesKeysTypes_1, clause, clause_index, component); - if_block.c(); - if_block.m(div_2, null); - } - - if (clause.type !== "selector") { - if (if_block_1) { - if_block_1.p(changed, state, clausesKeysTypes_1, clause, clause_index); - } else { - if_block_1 = create_if_block_8(state, clausesKeysTypes_1, clause, clause_index, component); - if_block_1.c(); - if_block_1.m(div, null); - } - } else if (if_block_1) { - if_block_1.u(); - if_block_1.d(); - if_block_1 = null; - } - }, - - u: function unmount() { - detachNode(div); - if_block.u(); - if (if_block_1) if_block_1.u(); - }, - - d: function destroy() { - if_block.d(); - if (if_block_1) if_block_1.d(); - } - }; - } - - // (63:14) {{#each selector[clause.key] as clauseEntry, index}} - function create_each_block_2(state, clausesKeysTypes_1, clause, clause_index, each_value, clauseEntry, index, component) { - var div, - text, - input, - input_updating = false, - text_1, - valueeditor_updating = {}, - text_2, - button; - - function input_input_handler() { - var context = input._svelte; - var state = component.get(); - input_updating = true; - context.each_value[context.index][0] = input.value; - component.set({ selector: state.selector, clausesKeysTypes: state.clausesKeysTypes }); - input_updating = false; - } - - var valueeditor_initial_data = { - valueTypeInitial: clause.type.type, - allowedTypes: clause.type.allowedTypes, - classCheckbox: state.classCheckbox, - classInput: state.classInput, - classSelect: state.classSelect - }; - if (index in each_value) { - valueeditor_initial_data.value = clauseEntry[1]; - valueeditor_updating.value = true; - } - if (index in each_value) { - valueeditor_initial_data.wholeEntry = clauseEntry; - valueeditor_updating.wholeEntry = true; - } - var valueeditor = new _ValueEditor2.default({ - root: component.root, - data: valueeditor_initial_data, - _bind: function _bind(changed, childState) { - var state = component.get(), - newState = {}; - if (!valueeditor_updating.value && changed.value) { - var list = valueeditor_context.each_value; - var index = valueeditor_context.index; - list[index][1] = childState.value; - - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - - if (!valueeditor_updating.wholeEntry && changed.wholeEntry) { - var list = valueeditor_context.each_value; - var index = valueeditor_context.index; - list[index] = childState.wholeEntry; - - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = assign({}, changed); - component._set(newState); - valueeditor_updating = {}; - } - }); - - component.root._beforecreate.push(function () { - var state = component.get(), - childState = valueeditor.get(), - newState = {}; - if (!childState) return; - if (!valueeditor_updating.value) { - var list = valueeditor_context.each_value; - var index = valueeditor_context.index; - list[index][1] = childState.value; - - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - - if (!valueeditor_updating.wholeEntry) { - var list = valueeditor_context.each_value; - var index = valueeditor_context.index; - list[index] = childState.wholeEntry; - - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = { value: true, wholeEntry: true }; - component._set(newState); - valueeditor_updating = {}; - }); - - valueeditor.on("makeDate", function (event) { - var clausesKeysTypes_1 = valueeditor_context.clausesKeysTypes_1, - clause_index = valueeditor_context.clause_index, - clause = clausesKeysTypes_1[clause_index]; - var each_value = valueeditor_context.each_value, - index = valueeditor_context.index, - clauseEntry = each_value[index]; - - component.makeDate(clause.key, index); - }); - valueeditor.on("makeNotDate", function (event) { - var clausesKeysTypes_1 = valueeditor_context.clausesKeysTypes_1, - clause_index = valueeditor_context.clause_index, - clause = clausesKeysTypes_1[clause_index]; - var each_value = valueeditor_context.each_value, - index = valueeditor_context.index, - clauseEntry = each_value[index]; - - component.makeNotDate(clause.key, index); - }); - - var valueeditor_context = { - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index, - each_value: each_value, - index: index - }; - - return { - c: function create() { - div = createElement("div"); - text = createText("["); - input = createElement("input"); - text_1 = createText(",\n "); - valueeditor._fragment.c(); - text_2 = createText("]\n "); - button = createElement("button"); - button.textContent = "Remove"; - this.h(); - }, - - h: function hydrate() { - addListener(input, "input", input_input_handler); - input.className = state.classInput; - input.type = "text"; - input.placeholder = "property name"; - - input._svelte = { - each_value: each_value, - index: index - }; - - button.className = state.classRemoveButton; - addListener(button, "click", click_handler_1); - - button._svelte = { - component: component, - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index, - each_value: each_value, - index: index - }; - - div.className = "clause-entry"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(text, div); - appendNode(input, div); - - input.value = clauseEntry[0]; - - appendNode(text_1, div); - valueeditor._mount(div, null); - appendNode(text_2, div); - appendNode(button, div); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index, each_value, clauseEntry, index) { - if (!input_updating) input.value = clauseEntry[0]; - if (changed.classInput) { - input.className = state.classInput; - } - - input._svelte.each_value = each_value; - input._svelte.index = index; - - var valueeditor_changes = {}; - if (changed.clausesKeysTypes) valueeditor_changes.valueTypeInitial = clause.type.type; - if (changed.clausesKeysTypes) valueeditor_changes.allowedTypes = clause.type.allowedTypes; - if (changed.classCheckbox) valueeditor_changes.classCheckbox = state.classCheckbox; - if (changed.classInput) valueeditor_changes.classInput = state.classInput; - if (changed.classSelect) valueeditor_changes.classSelect = state.classSelect; - if (!valueeditor_updating.value && changed.selector || changed.clausesKeysTypes) { - valueeditor_changes.value = clauseEntry[1]; - valueeditor_updating.value = true; - } - if (!valueeditor_updating.wholeEntry && changed.selector || changed.clausesKeysTypes) { - valueeditor_changes.wholeEntry = clauseEntry; - valueeditor_updating.wholeEntry = true; - } - valueeditor._set(valueeditor_changes); - valueeditor_updating = {}; - - valueeditor_context.clausesKeysTypes_1 = clausesKeysTypes_1; - valueeditor_context.clause_index = clause_index; - valueeditor_context.each_value = each_value; - valueeditor_context.index = index; - - if (changed.classRemoveButton) { - button.className = state.classRemoveButton; - } - - button._svelte.clausesKeysTypes_1 = clausesKeysTypes_1; - button._svelte.clause_index = clause_index; - button._svelte.each_value = each_value; - button._svelte.index = index; - }, - - u: function unmount() { - detachNode(div); - }, - - d: function destroy() { - removeListener(input, "input", input_input_handler); - valueeditor.destroy(false); - removeListener(button, "click", click_handler_1); - } - }; - } - - // (62:12) {{#if isCompoundVectorClauseKeys[clause.key]}} - function create_if_block_4(state, clausesKeysTypes_1, clause, clause_index, component) { - var each_anchor; - - var each_value = state.selector[clause.key]; - - var each_blocks = []; - - for (var i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block_2(state, clausesKeysTypes_1, clause, clause_index, each_value, each_value[i], i, component); - } - - return { - c: function create() { - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - each_anchor = createComment(); - }, - - m: function mount(target, anchor) { - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(target, anchor); - } - - insertNode(each_anchor, target, anchor); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - var each_value = state.selector[clause.key]; - - if (changed.classInput || changed.selector || changed.clausesKeysTypes || changed.classCheckbox || changed.classSelect || changed.classRemoveButton) { - for (var i = 0; i < each_value.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, clausesKeysTypes_1, clause, clause_index, each_value, each_value[i], i); - } else { - each_blocks[i] = create_each_block_2(state, clausesKeysTypes_1, clause, clause_index, each_value, each_value[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(each_anchor.parentNode, each_anchor); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = each_value.length; - } - }, - - u: function unmount() { - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - - detachNode(each_anchor); - }, - - d: function destroy() { - destroyEach(each_blocks); - } - }; - } - - // (79:12) {{else}} - function create_if_block_5(state, clausesKeysTypes_1, clause, clause_index, component) { - var div, - input, - input_updating = false, - text, - valueeditor_updating = {}; - - function input_input_handler() { - var state = component.get(); - input_updating = true; - state.selector[clause.key][0] = input.value; - component.set({ selector: state.selector }); - input_updating = false; - } - - var valueeditor_initial_data = { - valueTypeInitial: clause.type.type, - allowedTypes: clause.type.allowedTypes, - classCheckbox: state.classCheckbox, - classInput: state.classInput, - classSelect: state.classSelect - }; - if (1 in state.selector[clause.key]) { - valueeditor_initial_data.value = state.selector[clause.key][1]; - valueeditor_updating.value = true; - } - if (clause.key in state.selector) { - valueeditor_initial_data.wholeEntry = state.selector[clause.key]; - valueeditor_updating.wholeEntry = true; - } - var valueeditor = new _ValueEditor2.default({ - root: component.root, - data: valueeditor_initial_data, - _bind: function _bind(changed, childState) { - var state = component.get(), - newState = {}; - if (!valueeditor_updating.value && changed.value) { - state.selector[clause.key][1] = childState.value; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - - if (!valueeditor_updating.wholeEntry && changed.wholeEntry) { - state.selector[clause.key] = childState.wholeEntry; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = assign({}, changed); - component._set(newState); - valueeditor_updating = {}; - } - }); - - component.root._beforecreate.push(function () { - var state = component.get(), - childState = valueeditor.get(), - newState = {}; - if (!childState) return; - if (!valueeditor_updating.value) { - state.selector[clause.key][1] = childState.value; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - - if (!valueeditor_updating.wholeEntry) { - state.selector[clause.key] = childState.wholeEntry; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = { value: true, wholeEntry: true }; - component._set(newState); - valueeditor_updating = {}; - }); - - valueeditor.on("makeDate", function (event) { - var clausesKeysTypes_1 = valueeditor_context.clausesKeysTypes_1, - clause_index = valueeditor_context.clause_index, - clause = clausesKeysTypes_1[clause_index]; - - component.makeDate(clause.key, null); - }); - valueeditor.on("makeNotDate", function (event) { - var clausesKeysTypes_1 = valueeditor_context.clausesKeysTypes_1, - clause_index = valueeditor_context.clause_index, - clause = clausesKeysTypes_1[clause_index]; - - component.makeNotDate(clause.key, null); - }); - - var valueeditor_context = { - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index, - state: state - }; - - return { - c: function create() { - div = createElement("div"); - input = createElement("input"); - text = createText(",\n "); - valueeditor._fragment.c(); - this.h(); - }, - - h: function hydrate() { - addListener(input, "input", input_input_handler); - input.className = state.classInput; - input.type = "text"; - input.placeholder = "property name"; - - input._svelte = { - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index - }; - - div.className = "clause-entry"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(input, div); - - input.value = state.selector[clause.key][0]; - - appendNode(text, div); - valueeditor._mount(div, null); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - if (!input_updating) input.value = state.selector[clause.key][0]; - if (changed.classInput) { - input.className = state.classInput; - } - - input._svelte.clausesKeysTypes_1 = clausesKeysTypes_1; - input._svelte.clause_index = clause_index; - - var valueeditor_changes = {}; - if (changed.clausesKeysTypes) valueeditor_changes.valueTypeInitial = clause.type.type; - if (changed.clausesKeysTypes) valueeditor_changes.allowedTypes = clause.type.allowedTypes; - if (changed.classCheckbox) valueeditor_changes.classCheckbox = state.classCheckbox; - if (changed.classInput) valueeditor_changes.classInput = state.classInput; - if (changed.classSelect) valueeditor_changes.classSelect = state.classSelect; - if (!valueeditor_updating.value && changed.selector || changed.clausesKeysTypes) { - valueeditor_changes.value = state.selector[clause.key][1]; - valueeditor_updating.value = true; - } - if (!valueeditor_updating.wholeEntry && changed.selector || changed.clausesKeysTypes) { - valueeditor_changes.wholeEntry = state.selector[clause.key]; - valueeditor_updating.wholeEntry = true; - } - valueeditor._set(valueeditor_changes); - valueeditor_updating = {}; - - valueeditor_context.clausesKeysTypes_1 = clausesKeysTypes_1; - valueeditor_context.clause_index = clause_index; - valueeditor_context.state = state; - }, - - u: function unmount() { - detachNode(div); - }, - - d: function destroy() { - removeListener(input, "input", input_input_handler); - valueeditor.destroy(false); - } - }; - } - - // (96:14) {{#each selector[clause.key] as clauseEntry, index}} - function create_each_block_3(state, clausesKeysTypes_1, clause, clause_index, each_value, clauseEntry, index, component) { - var div, - valueeditor_updating = {}, - text, - button; - - var valueeditor_initial_data = { - valueTypeInitial: clause.type.type, - allowedTypes: clause.type.allowedTypes, - classCheckbox: state.classCheckbox, - classInput: state.classInput, - classSelect: state.classSelect - }; - if (index in each_value) { - valueeditor_initial_data.value = clauseEntry; - valueeditor_updating.value = true; - } - var valueeditor = new _ValueEditor2.default({ - root: component.root, - data: valueeditor_initial_data, - _bind: function _bind(changed, childState) { - var state = component.get(), - newState = {}; - if (!valueeditor_updating.value && changed.value) { - var list = valueeditor_context.each_value; - var index = valueeditor_context.index; - list[index] = childState.value; - - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = assign({}, changed); - component._set(newState); - valueeditor_updating = {}; - } - }); - - component.root._beforecreate.push(function () { - var state = component.get(), - childState = valueeditor.get(), - newState = {}; - if (!childState) return; - if (!valueeditor_updating.value) { - var list = valueeditor_context.each_value; - var index = valueeditor_context.index; - list[index] = childState.value; - - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = { value: true }; - component._set(newState); - valueeditor_updating = {}; - }); - - var valueeditor_context = { - each_value: each_value, - index: index - }; - - return { - c: function create() { - div = createElement("div"); - valueeditor._fragment.c(); - text = createText("\n "); - button = createElement("button"); - button.textContent = "Remove"; - this.h(); - }, - - h: function hydrate() { - button.className = state.classRemoveButton; - addListener(button, "click", click_handler_2); - - button._svelte = { - component: component, - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index, - each_value: each_value, - index: index - }; - - div.className = "clause-entry"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - valueeditor._mount(div, null); - appendNode(text, div); - appendNode(button, div); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index, each_value, clauseEntry, index) { - var valueeditor_changes = {}; - if (changed.clausesKeysTypes) valueeditor_changes.valueTypeInitial = clause.type.type; - if (changed.clausesKeysTypes) valueeditor_changes.allowedTypes = clause.type.allowedTypes; - if (changed.classCheckbox) valueeditor_changes.classCheckbox = state.classCheckbox; - if (changed.classInput) valueeditor_changes.classInput = state.classInput; - if (changed.classSelect) valueeditor_changes.classSelect = state.classSelect; - if (!valueeditor_updating.value && changed.selector || changed.clausesKeysTypes) { - valueeditor_changes.value = clauseEntry; - valueeditor_updating.value = true; - } - valueeditor._set(valueeditor_changes); - valueeditor_updating = {}; - - valueeditor_context.each_value = each_value; - valueeditor_context.index = index; - - if (changed.classRemoveButton) { - button.className = state.classRemoveButton; - } - - button._svelte.clausesKeysTypes_1 = clausesKeysTypes_1; - button._svelte.clause_index = clause_index; - button._svelte.each_value = each_value; - button._svelte.index = index; - }, - - u: function unmount() { - detachNode(div); - }, - - d: function destroy() { - valueeditor.destroy(false); - removeListener(button, "click", click_handler_2); - } - }; - } - - // (61:10) {{#if clause.type.vector}} - function create_if_block_3(state, clausesKeysTypes_1, clause, clause_index, component) { - var if_block_anchor; - - var current_block_type = select_block_type(state, clausesKeysTypes_1, clause, clause_index); - var if_block = current_block_type(state, clausesKeysTypes_1, clause, clause_index, component); - - return { - c: function create() { - if_block.c(); - if_block_anchor = createComment(); - }, - - m: function mount(target, anchor) { - if_block.m(target, anchor); - insertNode(if_block_anchor, target, anchor); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - if (current_block_type === (current_block_type = select_block_type(state, clausesKeysTypes_1, clause, clause_index)) && if_block) { - if_block.p(changed, state, clausesKeysTypes_1, clause, clause_index); - } else { - if_block.u(); - if_block.d(); - if_block = current_block_type(state, clausesKeysTypes_1, clause, clause_index, component); - if_block.c(); - if_block.m(if_block_anchor.parentNode, if_block_anchor); - } - }, - - u: function unmount() { - if_block.u(); - detachNode(if_block_anchor); - }, - - d: function destroy() { - if_block.d(); - } - }; - } - - // (95:12) {{#if isCompoundScalarClauseKeys[clause.key]}} - function create_if_block_6(state, clausesKeysTypes_1, clause, clause_index, component) { - var each_anchor; - - var each_value = state.selector[clause.key]; - - var each_blocks = []; - - for (var i = 0; i < each_value.length; i += 1) { - each_blocks[i] = create_each_block_3(state, clausesKeysTypes_1, clause, clause_index, each_value, each_value[i], i, component); - } - - return { - c: function create() { - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].c(); - } - - each_anchor = createComment(); - }, - - m: function mount(target, anchor) { - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].m(target, anchor); - } - - insertNode(each_anchor, target, anchor); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - var each_value = state.selector[clause.key]; - - if (changed.selector || changed.clausesKeysTypes || changed.classCheckbox || changed.classInput || changed.classSelect || changed.classRemoveButton) { - for (var i = 0; i < each_value.length; i += 1) { - if (each_blocks[i]) { - each_blocks[i].p(changed, state, clausesKeysTypes_1, clause, clause_index, each_value, each_value[i], i); - } else { - each_blocks[i] = create_each_block_3(state, clausesKeysTypes_1, clause, clause_index, each_value, each_value[i], i, component); - each_blocks[i].c(); - each_blocks[i].m(each_anchor.parentNode, each_anchor); - } - } - - for (; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - each_blocks[i].d(); - } - each_blocks.length = each_value.length; - } - }, - - u: function unmount() { - for (var i = 0; i < each_blocks.length; i += 1) { - each_blocks[i].u(); - } - - detachNode(each_anchor); - }, - - d: function destroy() { - destroyEach(each_blocks); - } - }; - } - - // (108:12) {{else}} - function create_if_block_7(state, clausesKeysTypes_1, clause, clause_index, component) { - var div, - valueeditor_updating = {}; - - var valueeditor_initial_data = { - valueTypeInitial: clause.type.type, - allowedTypes: clause.type.allowedTypes, - classCheckbox: state.classCheckbox, - classInput: state.classInput, - classSelect: state.classSelect - }; - if (clause.key in state.selector) { - valueeditor_initial_data.value = state.selector[clause.key]; - valueeditor_updating.value = true; - } - var valueeditor = new _ValueEditor2.default({ - root: component.root, - data: valueeditor_initial_data, - _bind: function _bind(changed, childState) { - var state = component.get(), - newState = {}; - if (!valueeditor_updating.value && changed.value) { - state.selector[clause.key] = childState.value; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = assign({}, changed); - component._set(newState); - valueeditor_updating = {}; - } - }); - - component.root._beforecreate.push(function () { - var state = component.get(), - childState = valueeditor.get(), - newState = {}; - if (!childState) return; - if (!valueeditor_updating.value) { - state.selector[clause.key] = childState.value; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - valueeditor_updating = { value: true }; - component._set(newState); - valueeditor_updating = {}; - }); - - var valueeditor_context = { - state: state, - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index - }; - - return { - c: function create() { - div = createElement("div"); - valueeditor._fragment.c(); - this.h(); - }, - - h: function hydrate() { - div.className = "clause-entry"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - valueeditor._mount(div, null); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - var valueeditor_changes = {}; - if (changed.clausesKeysTypes) valueeditor_changes.valueTypeInitial = clause.type.type; - if (changed.clausesKeysTypes) valueeditor_changes.allowedTypes = clause.type.allowedTypes; - if (changed.classCheckbox) valueeditor_changes.classCheckbox = state.classCheckbox; - if (changed.classInput) valueeditor_changes.classInput = state.classInput; - if (changed.classSelect) valueeditor_changes.classSelect = state.classSelect; - if (!valueeditor_updating.value && changed.selector || changed.clausesKeysTypes) { - valueeditor_changes.value = state.selector[clause.key]; - valueeditor_updating.value = true; - } - valueeditor._set(valueeditor_changes); - valueeditor_updating = {}; - - valueeditor_context.state = state; - valueeditor_context.clausesKeysTypes_1 = clausesKeysTypes_1; - valueeditor_context.clause_index = clause_index; - }, - - u: function unmount() { - detachNode(div); - }, - - d: function destroy() { - valueeditor.destroy(false); - } - }; - } - - // (47:8) {{#if clause.type === "selector"}} - function create_if_block_1(state, clausesKeysTypes_1, clause, clause_index, component) { - var selectoreditor_updating = {}; - - var selectoreditor_initial_data = { - classCheckbox: state.classCheckbox, - classInput: state.classInput, - classSelect: state.classSelect, - classAddButton: state.classAddButton, - classRemoveButton: state.classRemoveButton - }; - if (clause.key in state.selector) { - selectoreditor_initial_data.selector = state.selector[clause.key]; - selectoreditor_updating.selector = true; - } - var selectoreditor = new SelectorEditor({ - root: component.root, - data: selectoreditor_initial_data, - _bind: function _bind(changed, childState) { - var state = component.get(), - newState = {}; - if (!selectoreditor_updating.selector && changed.selector) { - state.selector[clause.key] = childState.selector; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - selectoreditor_updating = assign({}, changed); - component._set(newState); - selectoreditor_updating = {}; - } - }); - - component.root._beforecreate.push(function () { - var state = component.get(), - childState = selectoreditor.get(), - newState = {}; - if (!childState) return; - if (!selectoreditor_updating.selector) { - state.selector[clause.key] = childState.selector; - newState.selector = state.selector; - newState.clausesKeysTypes = state.clausesKeysTypes; - } - selectoreditor_updating = { selector: true }; - component._set(newState); - selectoreditor_updating = {}; - }); - - selectoreditor.on("remove", function (event) { - var clausesKeysTypes_1 = selectoreditor_context.clausesKeysTypes_1, - clause_index = selectoreditor_context.clause_index, - clause = clausesKeysTypes_1[clause_index]; - - component.removeSelector(clause.key); - }); - - var selectoreditor_context = { - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index, - state: state - }; - - return { - c: function create() { - selectoreditor._fragment.c(); - }, - - m: function mount(target, anchor) { - selectoreditor._mount(target, anchor); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - var selectoreditor_changes = {}; - if (changed.classCheckbox) selectoreditor_changes.classCheckbox = state.classCheckbox; - if (changed.classInput) selectoreditor_changes.classInput = state.classInput; - if (changed.classSelect) selectoreditor_changes.classSelect = state.classSelect; - if (changed.classAddButton) selectoreditor_changes.classAddButton = state.classAddButton; - if (changed.classRemoveButton) selectoreditor_changes.classRemoveButton = state.classRemoveButton; - if (!selectoreditor_updating.selector && changed.selector || changed.clausesKeysTypes) { - selectoreditor_changes.selector = state.selector[clause.key]; - selectoreditor_updating.selector = true; - } - selectoreditor._set(selectoreditor_changes); - selectoreditor_updating = {}; - - selectoreditor_context.clausesKeysTypes_1 = clausesKeysTypes_1; - selectoreditor_context.clause_index = clause_index; - selectoreditor_context.state = state; - }, - - u: function unmount() { - selectoreditor._unmount(); - }, - - d: function destroy() { - selectoreditor.destroy(false); - } - }; - } - - // (56:8) {{else}} - function create_if_block_2(state, clausesKeysTypes_1, clause, clause_index, component) { - var div, button, text_2, text_3; - - var current_block_type = select_block_type_1(state, clausesKeysTypes_1, clause, clause_index); - var if_block = current_block_type(state, clausesKeysTypes_1, clause, clause_index, component); - - return { - c: function create() { - div = createElement("div"); - button = createElement("button"); - button.textContent = "Add Entry"; - text_2 = createText("\n [\n "); - if_block.c(); - text_3 = createText("\n ]"); - this.h(); - }, - - h: function hydrate() { - button.className = state.classAddButton; - addListener(button, "click", click_handler); - - button._svelte = { - component: component, - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index - }; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(button, div); - insertNode(text_2, target, anchor); - if_block.m(target, anchor); - insertNode(text_3, target, anchor); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - if (changed.classAddButton) { - button.className = state.classAddButton; - } - - button._svelte.clausesKeysTypes_1 = clausesKeysTypes_1; - button._svelte.clause_index = clause_index; - - if (current_block_type === (current_block_type = select_block_type_1(state, clausesKeysTypes_1, clause, clause_index)) && if_block) { - if_block.p(changed, state, clausesKeysTypes_1, clause, clause_index); - } else { - if_block.u(); - if_block.d(); - if_block = current_block_type(state, clausesKeysTypes_1, clause, clause_index, component); - if_block.c(); - if_block.m(text_3.parentNode, text_3); - } - }, - - u: function unmount() { - detachNode(div); - detachNode(text_2); - if_block.u(); - detachNode(text_3); - }, - - d: function destroy() { - removeListener(button, "click", click_handler); - if_block.d(); - } - }; - } - - // (123:6) {{#if clause.type !== "selector"}} - function create_if_block_8(state, clausesKeysTypes_1, clause, clause_index, component) { - var div, button; - - return { - c: function create() { - div = createElement("div"); - button = createElement("button"); - button.textContent = "Remove"; - this.h(); - }, - - h: function hydrate() { - button.className = state.classRemoveButton; - addListener(button, "click", click_handler_3); - - button._svelte = { - component: component, - clausesKeysTypes_1: clausesKeysTypes_1, - clause_index: clause_index - }; - - div.className = "remove"; - }, - - m: function mount(target, anchor) { - insertNode(div, target, anchor); - appendNode(button, div); - }, - - p: function update(changed, state, clausesKeysTypes_1, clause, clause_index) { - if (changed.classRemoveButton) { - button.className = state.classRemoveButton; - } - - button._svelte.clausesKeysTypes_1 = clausesKeysTypes_1; - button._svelte.clause_index = clause_index; - }, - - u: function unmount() { - detachNode(div); - }, - - d: function destroy() { - removeListener(button, "click", click_handler_3); - } - }; - } - - function click_handler(event) { - var component = this._svelte.component; - var clausesKeysTypes_1 = this._svelte.clausesKeysTypes_1, - clause_index = this._svelte.clause_index, - clause = clausesKeysTypes_1[clause_index]; - component.addClauseEntry(clause.key); - } - - function click_handler_1(event) { - var component = this._svelte.component; - var clausesKeysTypes_1 = this._svelte.clausesKeysTypes_1, - clause_index = this._svelte.clause_index, - clause = clausesKeysTypes_1[clause_index]; - var each_value = this._svelte.each_value, - index = this._svelte.index, - clauseEntry = each_value[index]; - component.removeClauseEntry(clause.key, index); - } - - function select_block_type(state, clausesKeysTypes_1, clause, clause_index) { - if (state.isCompoundVectorClauseKeys[clause.key]) return create_if_block_4; - return create_if_block_5; - } - - function click_handler_2(event) { - var component = this._svelte.component; - var clausesKeysTypes_1 = this._svelte.clausesKeysTypes_1, - clause_index = this._svelte.clause_index, - clause = clausesKeysTypes_1[clause_index]; - var each_value = this._svelte.each_value, - index = this._svelte.index, - clauseEntry = each_value[index]; - component.removeClauseEntry(clause.key, index); - } - - function select_block_type_1(state, clausesKeysTypes_1, clause, clause_index) { - if (clause.type.vector) return create_if_block_3; - if (state.isCompoundScalarClauseKeys[clause.key]) return create_if_block_6; - return create_if_block_7; - } - - function select_block_type_2(state, clausesKeysTypes_1, clause, clause_index) { - if (clause.type === "selector") return create_if_block_1; - return create_if_block_2; - } - - function click_handler_3(event) { - var component = this._svelte.component; - var clausesKeysTypes_1 = this._svelte.clausesKeysTypes_1, - clause_index = this._svelte.clause_index, - clause = clausesKeysTypes_1[clause_index]; - component.removeClause(clause.key); - } - - function SelectorEditor(options) { - init(this, options); - this._state = assign(data(), options.data); - this._recompute({ selector: 1, supportedClauses: 1 }, this._state); - - if (!document.getElementById("svelte-987364770-style")) add_css(); - - if (!options.root) { - this._oncreate = []; - this._beforecreate = []; - this._aftercreate = []; - } - - this._fragment = create_main_fragment(this._state, this); - - if (options.target) { - this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); - - this._lock = true; - callAll(this._beforecreate); - callAll(this._oncreate); - callAll(this._aftercreate); - this._lock = false; - } - } - - assign(SelectorEditor.prototype, methods, { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, - _set: _set, - _mount: _mount, - _unmount: _unmount - }); - - SelectorEditor.prototype._recompute = function _recompute(changed, state) { - if (changed.selector || changed.supportedClauses) { - if (differs(state.remainingClauses, state.remainingClauses = remainingClauses(state.selector, state.supportedClauses))) changed.remainingClauses = true; - if (differs(state.clausesKeysTypes, state.clausesKeysTypes = clausesKeysTypes(state.selector, state.supportedClauses))) changed.clausesKeysTypes = true; - if (differs(state.isCompoundVectorClauseKeys, state.isCompoundVectorClauseKeys = isCompoundVectorClauseKeys(state.selector, state.supportedClauses))) changed.isCompoundVectorClauseKeys = true; - if (differs(state.isCompoundScalarClauseKeys, state.isCompoundScalarClauseKeys = isCompoundScalarClauseKeys(state.selector, state.supportedClauses))) changed.isCompoundScalarClauseKeys = true; - } - }; - - function setAttribute(node, attribute, value) { - node.setAttribute(attribute, value); - } - - function createElement(name) { - return document.createElement(name); - } - - function appendNode(node, target) { - target.appendChild(node); - } - - function selectValue(select) { - var selectedOption = select.querySelector(':checked') || select.options[0]; - return selectedOption && selectedOption.__value; - } - - function createText(data) { - return document.createTextNode(data); - } - - function addListener(node, event, handler) { - node.addEventListener(event, handler, false); - } - - function insertNode(node, target, anchor) { - target.insertBefore(node, anchor); - } - - function selectOption(select, value) { - for (var i = 0; i < select.options.length; i += 1) { - var option = select.options[i]; - - if (option.__value === value) { - option.selected = true; - return; - } - } - } - - function detachNode(node) { - node.parentNode.removeChild(node); - } - - function removeListener(node, event, handler) { - node.removeEventListener(event, handler, false); - } - - function destroyEach(iterations) { - for (var i = 0; i < iterations.length; i += 1) { - if (iterations[i]) iterations[i].d(); - } - } - - function noop() {} - - function assign(target) { - var k, - source, - i = 1, - len = arguments.length; - for (; i < len; i++) { - source = arguments[i]; - for (k in source) { - target[k] = source[k]; - } - } - - return target; - } - - function createComment() { - return document.createComment(''); - } - - function init(component, options) { - component._observers = { pre: blankObject(), post: blankObject() }; - component._handlers = blankObject(); - component._bind = options._bind; - - component.options = options; - component.root = options.root || component; - component.store = component.root.store || options.store; - } - - function callAll(fns) { - while (fns && fns.length) { - fns.pop()(); - } - } - - function destroy(detach) { - this.destroy = noop; - this.fire('destroy'); - this.set = this.get = noop; - - if (detach !== false) this._fragment.u(); - this._fragment.d(); - this._fragment = this._state = null; - } - - function get(key) { - return key ? this._state[key] : this._state; - } - - function fire(eventName, data) { - var handlers = eventName in this._handlers && this._handlers[eventName].slice(); - if (!handlers) return; - - for (var i = 0; i < handlers.length; i += 1) { - handlers[i].call(this, data); - } - } - - function observe(key, callback, options) { - var group = options && options.defer ? this._observers.post : this._observers.pre; - - (group[key] || (group[key] = [])).push(callback); - - if (!options || options.init !== false) { - callback.__calling = true; - callback.call(this, this._state[key]); - callback.__calling = false; - } - - return { - cancel: function cancel() { - var index = group[key].indexOf(callback); - if (~index) group[key].splice(index, 1); - } - }; - } - - function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); - handlers.push(handler); - - return { - cancel: function cancel() { - var index = handlers.indexOf(handler); - if (~index) handlers.splice(index, 1); - } - }; - } - - function set(newState) { - this._set(assign({}, newState)); - if (this.root._lock) return; - this.root._lock = true; - callAll(this.root._beforecreate); - callAll(this.root._oncreate); - callAll(this.root._aftercreate); - this.root._lock = false; - } - - function _set(newState) { - var oldState = this._state, - changed = {}, - dirty = false; - - for (var key in newState) { - if (differs(newState[key], oldState[key])) changed[key] = dirty = true; - } - if (!dirty) return; - - this._state = assign({}, oldState, newState); - this._recompute(changed, this._state); - if (this._bind) this._bind(changed, this._state); - - if (this._fragment) { - dispatchObservers(this, this._observers.pre, changed, this._state, oldState); - this._fragment.p(changed, this._state); - dispatchObservers(this, this._observers.post, changed, this._state, oldState); - } - } - - function _mount(target, anchor) { - this._fragment.m(target, anchor); - } - - function _unmount() { - if (this._fragment) this._fragment.u(); - } - - function differs(a, b) { - return a !== b || a && (typeof a === 'undefined' ? 'undefined' : _typeof(a)) === 'object' || typeof a === 'function'; - } - - function blankObject() { - return Object.create(null); - } - - function dispatchObservers(component, group, changed, newState, oldState) { - for (var key in group) { - if (!changed[key]) continue; - - var newValue = newState[key]; - var oldValue = oldState[key]; - - var callbacks = group[key]; - if (!callbacks) continue; - - for (var i = 0; i < callbacks.length; i += 1) { - var callback = callbacks[i]; - if (callback.__calling) continue; - - callback.__calling = true; - callback.call(component, newValue, oldValue); - callback.__calling = false; - } - } - } - exports.default = SelectorEditor; -}); diff --git a/lib/ValueEditor.js b/lib/ValueEditor.js deleted file mode 100644 index ff75c9b..0000000 --- a/lib/ValueEditor.js +++ /dev/null @@ -1,1164 +0,0 @@ -(function (global, factory) { - if (typeof define === "function" && define.amd) { - define(["exports", "locutus/php/datetime/strtotime"], factory); - } else if (typeof exports !== "undefined") { - factory(exports, require("locutus/php/datetime/strtotime")); - } else { - var mod = { - exports: {} - }; - factory(mod.exports, global.strtotime); - global.ValueEditor = mod.exports; - } -})(this, function (exports) { - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { - return typeof obj; - } : function (obj) { - return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; - }; - - /* src/ValueEditor.html generated by Svelte v1.51.1 */ - - var strtotime = window.strtotime; - - function valueType(value, valueTypeCurrent, allowedTypes) { - if (allowedTypes.length === 1) { - return allowedTypes[0]; - } - if (value === null) { - return "date"; - } - switch (typeof value === "undefined" ? "undefined" : _typeof(value)) { - case "number": - if (value % 1 > 0) { - return valueTypeCurrent || "float"; - } else { - return valueTypeCurrent || "int"; - } - case "boolean": - return "boolean"; - case "string": - default: - return "string"; - } - } - - function data() { - return { - __dateInputTimestamp: 0, - __dateInputInterpretation: "", - valueTypeInitial: null, - valueTypeCurrent: null, - allowedTypes: ["string", "int", "float", "boolean", "date"], - value: "", - wholeValue: ["", ""], - classCheckbox: '', - classInput: '', - classSelect: '' - }; - }; - - var methods = { - changeValueType: function changeValueType() { - var valueTypeCurrent = this.get("valueTypeCurrent"); - var value = this.get("value"); - - switch (valueTypeCurrent) { - case "string": - this.fire("makeNotDate"); - value = "" + value; - break; - case "int": - this.fire("makeNotDate"); - value = parseInt(value, 10); - break; - case "float": - this.fire("makeNotDate"); - value = parseFloat(value, 10); - break; - case "boolean": - this.fire("makeNotDate"); - value = !!value; - break; - case "date": - this.fire("makeDate"); - this.handleDateInput(); - return; - } - - this.set({ value: value }); - }, - handleDateInput: function handleDateInput() { - var wholeEntry = this.get("wholeEntry"); - var dateString = wholeEntry[2]; - var match = dateString.match(/^\s*(\d+)?\s*(?:jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sep(?:t(?:ember)?)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)\s*(\d+)?\s*$/i); - if (match) { - if (match[1] === undefined && match[2] === undefined) { - dateString += " " + new Date().getDate() + " "; - } - dateString += " " + new Date().getFullYear(); - } - var __dateInputTimestamp = this.interpretDate(dateString); - var __dateInputInterpretation = __dateInputTimestamp ? this.formatDate(__dateInputTimestamp) : "Unrecognized"; - - this.set({ - __dateInputTimestamp: __dateInputTimestamp, - __dateInputInterpretation: __dateInputInterpretation - }); - }, - interpretDate: function interpretDate(input) { - return strtotime("" + input); - }, - formatDate: function formatDate(timestamp) { - return new Date(timestamp * 1000).toLocaleString(undefined, { - weekday: "long", - year: "numeric", - month: "long", - day: "numeric", - hour: "numeric", - minute: "numeric", - second: "numeric", - timeZoneName: "short" - }); - }, - makeInt: function makeInt() { - this.set({ value: parseInt(this.get("value"), 10) }); - } - }; - - function oncreate() { - var _this = this; - - if (!strtotime) { - throw new Error("ValueEditor requires Locutus' strtotime for date interpretation."); - } - - var valueTypeInitial = this.get("valueTypeInitial"); - var value = this.get("value"); - var valueTypeCurrent = void 0; - if (value === null) { - valueTypeCurrent = "date"; - } else { - valueTypeCurrent = valueTypeInitial === null ? this.get("valueType") : valueTypeInitial; - } - this.set({ valueTypeCurrent: valueTypeCurrent }); - - if (valueTypeCurrent === "date") { - this.handleDateInput(); - } - - this.observe("valueTypeCurrent", function (value) { - if (value === "date") { - if (!_this.dateHandleInterval) { - _this.dateHandleInterval = setInterval(function () { - return _this.handleDateInput(); - }, 1000); - } - } else { - if (_this.dateHandleInterval) { - clearInterval(_this.dateHandleInterval); - _this.dateHandleInterval = false; - } - } - }); - - this.observe("value", function (newValue, oldValue) { - if (newValue === null && oldValue !== null || newValue !== null && oldValue === null || (typeof newValue === "undefined" ? "undefined" : _typeof(newValue)) !== (typeof oldValue === "undefined" ? "undefined" : _typeof(oldValue))) { - var _valueType = _this.get("valueType"); - _this.set({ valueTypeCurrent: _valueType }); - if (_valueType === "date") { - _this.handleDateInput(); - } - } - }, { init: false }); - }; - - function ondestroy() { - if (this.dateHandleInterval) { - clearInterval(this.dateHandleInterval); - this.dateHandleInterval = false; - } - }; - - function create_main_fragment(state, component) { - var span, text; - - var if_block = state.allowedTypes.length > 1 && create_if_block(state, component); - - var current_block_type = select_block_type_1(state); - var if_block_1 = current_block_type && current_block_type(state, component); - - return { - c: function create() { - span = createElement("span"); - if (if_block) if_block.c(); - text = createText("\n "); - if (if_block_1) if_block_1.c(); - }, - - m: function mount(target, anchor) { - insertNode(span, target, anchor); - if (if_block) if_block.m(span, null); - appendNode(text, span); - if (if_block_1) if_block_1.m(span, null); - }, - - p: function update(changed, state) { - if (state.allowedTypes.length > 1) { - if (if_block) { - if_block.p(changed, state); - } else { - if_block = create_if_block(state, component); - if_block.c(); - if_block.m(span, text); - } - } else if (if_block) { - if_block.u(); - if_block.d(); - if_block = null; - } - - if (current_block_type === (current_block_type = select_block_type_1(state)) && if_block_1) { - if_block_1.p(changed, state); - } else { - if (if_block_1) { - if_block_1.u(); - if_block_1.d(); - } - if_block_1 = current_block_type && current_block_type(state, component); - if (if_block_1) if_block_1.c(); - if (if_block_1) if_block_1.m(span, null); - } - }, - - u: function unmount() { - detachNode(span); - if (if_block) if_block.u(); - if (if_block_1) if_block_1.u(); - }, - - d: function destroy() { - if (if_block) if_block.d(); - if (if_block_1) if_block_1.d(); - } - }; - } - - // (4:6) {{#if allowedTypes.indexOf("string") > -1}} - function create_if_block_1(state, component) { - var option, text; - - return { - c: function create() { - option = createElement("option"); - text = createText("String"); - this.h(); - }, - - h: function hydrate() { - option.__value = "string"; - option.value = option.__value; - }, - - m: function mount(target, anchor) { - insertNode(option, target, anchor); - appendNode(text, option); - }, - - u: function unmount() { - detachNode(option); - }, - - d: noop - }; - } - - // (9:6) {{#if allowedTypes.indexOf("int") > -1}} - function create_if_block_2(state, component) { - var option, text; - - return { - c: function create() { - option = createElement("option"); - text = createText("Integer"); - this.h(); - }, - - h: function hydrate() { - option.__value = "int"; - option.value = option.__value; - }, - - m: function mount(target, anchor) { - insertNode(option, target, anchor); - appendNode(text, option); - }, - - u: function unmount() { - detachNode(option); - }, - - d: noop - }; - } - - // (14:6) {{#if allowedTypes.indexOf("float") > -1}} - function create_if_block_3(state, component) { - var option, text; - - return { - c: function create() { - option = createElement("option"); - text = createText("Float"); - this.h(); - }, - - h: function hydrate() { - option.__value = "float"; - option.value = option.__value; - }, - - m: function mount(target, anchor) { - insertNode(option, target, anchor); - appendNode(text, option); - }, - - u: function unmount() { - detachNode(option); - }, - - d: noop - }; - } - - // (19:6) {{#if allowedTypes.indexOf("boolean") > -1}} - function create_if_block_4(state, component) { - var option, text; - - return { - c: function create() { - option = createElement("option"); - text = createText("Boolean"); - this.h(); - }, - - h: function hydrate() { - option.__value = "boolean"; - option.value = option.__value; - }, - - m: function mount(target, anchor) { - insertNode(option, target, anchor); - appendNode(text, option); - }, - - u: function unmount() { - detachNode(option); - }, - - d: noop - }; - } - - // (24:6) {{#if allowedTypes.indexOf("date") > -1}} - function create_if_block_5(state, component) { - var option, text; - - return { - c: function create() { - option = createElement("option"); - text = createText("Date"); - this.h(); - }, - - h: function hydrate() { - option.__value = "date"; - option.value = option.__value; - }, - - m: function mount(target, anchor) { - insertNode(option, target, anchor); - appendNode(text, option); - }, - - u: function unmount() { - detachNode(option); - }, - - d: noop - }; - } - - // (2:2) {{#if allowedTypes.length > 1}} - function create_if_block(state, component) { - var text, - select, - if_block_anchor, - if_block_1_anchor, - if_block_2_anchor, - if_block_3_anchor, - select_updating = false, - text_1; - - var if_block = state.allowedTypes.indexOf("string") > -1 && create_if_block_1(state, component); - - var if_block_1 = state.allowedTypes.indexOf("int") > -1 && create_if_block_2(state, component); - - var if_block_2 = state.allowedTypes.indexOf("float") > -1 && create_if_block_3(state, component); - - var if_block_3 = state.allowedTypes.indexOf("boolean") > -1 && create_if_block_4(state, component); - - var if_block_4 = state.allowedTypes.indexOf("date") > -1 && create_if_block_5(state, component); - - function select_change_handler() { - select_updating = true; - component.set({ valueTypeCurrent: selectValue(select) }); - select_updating = false; - } - - function change_handler(event) { - component.changeValueType(); - } - - return { - c: function create() { - text = createText("(Type: "); - select = createElement("select"); - if (if_block) if_block.c(); - if_block_anchor = createComment(); - if (if_block_1) if_block_1.c(); - if_block_1_anchor = createComment(); - if (if_block_2) if_block_2.c(); - if_block_2_anchor = createComment(); - if (if_block_3) if_block_3.c(); - if_block_3_anchor = createComment(); - if (if_block_4) if_block_4.c(); - text_1 = createText(")\n Value:"); - this.h(); - }, - - h: function hydrate() { - addListener(select, "change", select_change_handler); - if (!('valueTypeCurrent' in state)) component.root._beforecreate.push(select_change_handler); - select.className = state.classSelect; - addListener(select, "change", change_handler); - }, - - m: function mount(target, anchor) { - insertNode(text, target, anchor); - insertNode(select, target, anchor); - if (if_block) if_block.m(select, null); - appendNode(if_block_anchor, select); - if (if_block_1) if_block_1.m(select, null); - appendNode(if_block_1_anchor, select); - if (if_block_2) if_block_2.m(select, null); - appendNode(if_block_2_anchor, select); - if (if_block_3) if_block_3.m(select, null); - appendNode(if_block_3_anchor, select); - if (if_block_4) if_block_4.m(select, null); - - selectOption(select, state.valueTypeCurrent); - - insertNode(text_1, target, anchor); - }, - - p: function update(changed, state) { - if (state.allowedTypes.indexOf("string") > -1) { - if (!if_block) { - if_block = create_if_block_1(state, component); - if_block.c(); - if_block.m(select, if_block_anchor); - } - } else if (if_block) { - if_block.u(); - if_block.d(); - if_block = null; - } - - if (state.allowedTypes.indexOf("int") > -1) { - if (!if_block_1) { - if_block_1 = create_if_block_2(state, component); - if_block_1.c(); - if_block_1.m(select, if_block_1_anchor); - } - } else if (if_block_1) { - if_block_1.u(); - if_block_1.d(); - if_block_1 = null; - } - - if (state.allowedTypes.indexOf("float") > -1) { - if (!if_block_2) { - if_block_2 = create_if_block_3(state, component); - if_block_2.c(); - if_block_2.m(select, if_block_2_anchor); - } - } else if (if_block_2) { - if_block_2.u(); - if_block_2.d(); - if_block_2 = null; - } - - if (state.allowedTypes.indexOf("boolean") > -1) { - if (!if_block_3) { - if_block_3 = create_if_block_4(state, component); - if_block_3.c(); - if_block_3.m(select, if_block_3_anchor); - } - } else if (if_block_3) { - if_block_3.u(); - if_block_3.d(); - if_block_3 = null; - } - - if (state.allowedTypes.indexOf("date") > -1) { - if (!if_block_4) { - if_block_4 = create_if_block_5(state, component); - if_block_4.c(); - if_block_4.m(select, null); - } - } else if (if_block_4) { - if_block_4.u(); - if_block_4.d(); - if_block_4 = null; - } - - if (!select_updating) selectOption(select, state.valueTypeCurrent); - if (changed.classSelect) { - select.className = state.classSelect; - } - }, - - u: function unmount() { - detachNode(text); - detachNode(select); - if (if_block) if_block.u(); - if (if_block_1) if_block_1.u(); - if (if_block_2) if_block_2.u(); - if (if_block_3) if_block_3.u(); - if (if_block_4) if_block_4.u(); - detachNode(text_1); - }, - - d: function destroy() { - if (if_block) if_block.d(); - if (if_block_1) if_block_1.d(); - if (if_block_2) if_block_2.d(); - if (if_block_3) if_block_3.d(); - if (if_block_4) if_block_4.d(); - removeListener(select, "change", select_change_handler); - removeListener(select, "change", change_handler); - } - }; - } - - // (39:85) {{#if value}} - function create_if_block_10(state, component) { - var text; - - return { - c: function create() { - text = createText("True"); - }, - - m: function mount(target, anchor) { - insertNode(text, target, anchor); - }, - - u: function unmount() { - detachNode(text); - }, - - d: noop - }; - } - - // (39:102) {{else}} - function create_if_block_11(state, component) { - var text; - - return { - c: function create() { - text = createText("False"); - }, - - m: function mount(target, anchor) { - insertNode(text, target, anchor); - }, - - u: function unmount() { - detachNode(text); - }, - - d: noop - }; - } - - // (32:2) {{#if valueType === "string"}} - function create_if_block_6(state, component) { - var input, - input_updating = false; - - function input_input_handler() { - input_updating = true; - component.set({ value: input.value }); - input_updating = false; - } - - return { - c: function create() { - input = createElement("input"); - this.h(); - }, - - h: function hydrate() { - addListener(input, "input", input_input_handler); - input.className = state.classInput; - input.type = "text"; - }, - - m: function mount(target, anchor) { - insertNode(input, target, anchor); - - input.value = state.value; - }, - - p: function update(changed, state) { - if (!input_updating) input.value = state.value; - if (changed.classInput) { - input.className = state.classInput; - } - }, - - u: function unmount() { - detachNode(input); - }, - - d: function destroy() { - removeListener(input, "input", input_input_handler); - } - }; - } - - // (34:32) - function create_if_block_7(state, component) { - var input, - input_updating = false; - - function input_input_handler() { - input_updating = true; - component.set({ value: toNumber(input.value) }); - input_updating = false; - } - - function input_handler(event) { - component.makeInt(); - } - - return { - c: function create() { - input = createElement("input"); - this.h(); - }, - - h: function hydrate() { - addListener(input, "input", input_input_handler); - input.className = state.classInput; - input.type = "number"; - addListener(input, "input", input_handler); - }, - - m: function mount(target, anchor) { - insertNode(input, target, anchor); - - input.value = state.value; - }, - - p: function update(changed, state) { - if (!input_updating) input.value = state.value; - if (changed.classInput) { - input.className = state.classInput; - } - }, - - u: function unmount() { - detachNode(input); - }, - - d: function destroy() { - removeListener(input, "input", input_input_handler); - removeListener(input, "input", input_handler); - } - }; - } - - // (36:34) - function create_if_block_8(state, component) { - var input, - input_updating = false; - - function input_input_handler() { - input_updating = true; - component.set({ value: toNumber(input.value) }); - input_updating = false; - } - - return { - c: function create() { - input = createElement("input"); - this.h(); - }, - - h: function hydrate() { - addListener(input, "input", input_input_handler); - input.className = state.classInput; - input.type = "number"; - }, - - m: function mount(target, anchor) { - insertNode(input, target, anchor); - - input.value = state.value; - }, - - p: function update(changed, state) { - if (!input_updating) input.value = state.value; - if (changed.classInput) { - input.className = state.classInput; - } - }, - - u: function unmount() { - detachNode(input); - }, - - d: function destroy() { - removeListener(input, "input", input_input_handler); - } - }; - } - - // (38:36) - function create_if_block_9(state, component) { - var label, input, text, text_1; - - function input_change_handler() { - component.set({ value: input.checked }); - } - - var current_block_type = select_block_type(state); - var if_block = current_block_type(state, component); - - return { - c: function create() { - label = createElement("label"); - input = createElement("input"); - text = createText(" ("); - if_block.c(); - text_1 = createText(")"); - this.h(); - }, - - h: function hydrate() { - addListener(input, "change", input_change_handler); - input.className = state.classCheckbox; - input.type = "checkbox"; - }, - - m: function mount(target, anchor) { - insertNode(label, target, anchor); - appendNode(input, label); - - input.checked = state.value; - - appendNode(text, label); - if_block.m(label, null); - appendNode(text_1, label); - }, - - p: function update(changed, state) { - input.checked = state.value; - if (changed.classCheckbox) { - input.className = state.classCheckbox; - } - - if (current_block_type !== (current_block_type = select_block_type(state))) { - if_block.u(); - if_block.d(); - if_block = current_block_type(state, component); - if_block.c(); - if_block.m(label, text_1); - } - }, - - u: function unmount() { - detachNode(label); - if_block.u(); - }, - - d: function destroy() { - removeListener(input, "change", input_change_handler); - if_block.d(); - } - }; - } - - // (40:33) - function create_if_block_12(state, component) { - var input, - input_updating = false, - text, - code, - text_1, - text_2, - abbr; - - function input_input_handler() { - var state = component.get(); - input_updating = true; - state.wholeEntry[2] = input.value; - component.set({ wholeEntry: state.wholeEntry }); - input_updating = false; - } - - function input_handler(event) { - component.handleDateInput(); - } - - return { - c: function create() { - input = createElement("input"); - text = createText("\n Interpreted as: "); - code = createElement("code"); - text_1 = createText(state.__dateInputInterpretation); - text_2 = createText(" "); - abbr = createElement("abbr"); - abbr.textContent = "(!)"; - this.h(); - }, - - h: function hydrate() { - addListener(input, "input", input_input_handler); - input.className = state.classInput; - input.type = "text"; - input.placeholder = "Enter a date in basically any format, including things like \"now\", \"last friday\", \"+1 week\", and \"oct 12, 2017 3:00 pm\""; - input.title = "Enter a date in basically any format, including things like \"now\", \"last friday\", \"+1 week\", and \"oct 12, 2017 3:00 pm\""; - addListener(input, "input", input_handler); - code.className = "date-interpretation"; - abbr.title = "This interpretation may be inaccurate, as PHP's strtotime function may return slightly different results, and the server may be using a different timezone."; - }, - - m: function mount(target, anchor) { - insertNode(input, target, anchor); - - input.value = state.wholeEntry[2]; - - insertNode(text, target, anchor); - insertNode(code, target, anchor); - appendNode(text_1, code); - insertNode(text_2, target, anchor); - insertNode(abbr, target, anchor); - }, - - p: function update(changed, state) { - if (!input_updating) input.value = state.wholeEntry[2]; - if (changed.classInput) { - input.className = state.classInput; - } - - if (changed.__dateInputInterpretation) { - text_1.data = state.__dateInputInterpretation; - } - }, - - u: function unmount() { - detachNode(input); - detachNode(text); - detachNode(code); - detachNode(text_2); - detachNode(abbr); - }, - - d: function destroy() { - removeListener(input, "input", input_input_handler); - removeListener(input, "input", input_handler); - } - }; - } - - function select_block_type(state) { - if (state.value) return create_if_block_10; - return create_if_block_11; - } - - function select_block_type_1(state) { - if (state.valueType === "string") return create_if_block_6; - if (state.valueType === "int") return create_if_block_7; - if (state.valueType === "float") return create_if_block_8; - if (state.valueType === "boolean") return create_if_block_9; - if (state.valueType === "date") return create_if_block_12; - return null; - } - - function ValueEditor(options) { - init(this, options); - this._state = assign(data(), options.data); - this._recompute({ value: 1, valueTypeCurrent: 1, allowedTypes: 1 }, this._state); - - this._handlers.destroy = [ondestroy]; - - var _oncreate = oncreate.bind(this); - - if (!options.root) { - this._oncreate = [_oncreate]; - this._beforecreate = []; - } else { - this.root._oncreate.push(_oncreate); - } - - this._fragment = create_main_fragment(this._state, this); - - if (options.target) { - this._fragment.c(); - this._fragment.m(options.target, options.anchor || null); - - callAll(this._beforecreate); - callAll(this._oncreate); - } - } - - assign(ValueEditor.prototype, methods, { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, - _set: _set, - _mount: _mount, - _unmount: _unmount - }); - - ValueEditor.prototype._recompute = function _recompute(changed, state) { - if (changed.value || changed.valueTypeCurrent || changed.allowedTypes) { - if (differs(state.valueType, state.valueType = valueType(state.value, state.valueTypeCurrent, state.allowedTypes))) changed.valueType = true; - } - }; - - function createElement(name) { - return document.createElement(name); - } - - function createText(data) { - return document.createTextNode(data); - } - - function insertNode(node, target, anchor) { - target.insertBefore(node, anchor); - } - - function appendNode(node, target) { - target.appendChild(node); - } - - function detachNode(node) { - node.parentNode.removeChild(node); - } - - function noop() {} - - function selectValue(select) { - var selectedOption = select.querySelector(':checked') || select.options[0]; - return selectedOption && selectedOption.__value; - } - - function createComment() { - return document.createComment(''); - } - - function addListener(node, event, handler) { - node.addEventListener(event, handler, false); - } - - function selectOption(select, value) { - for (var i = 0; i < select.options.length; i += 1) { - var option = select.options[i]; - - if (option.__value === value) { - option.selected = true; - return; - } - } - } - - function removeListener(node, event, handler) { - node.removeEventListener(event, handler, false); - } - - function toNumber(value) { - return value === '' ? undefined : +value; - } - - function init(component, options) { - component._observers = { pre: blankObject(), post: blankObject() }; - component._handlers = blankObject(); - component._bind = options._bind; - - component.options = options; - component.root = options.root || component; - component.store = component.root.store || options.store; - } - - function assign(target) { - var k, - source, - i = 1, - len = arguments.length; - for (; i < len; i++) { - source = arguments[i]; - for (k in source) { - target[k] = source[k]; - } - } - - return target; - } - - function callAll(fns) { - while (fns && fns.length) { - fns.pop()(); - } - } - - function destroy(detach) { - this.destroy = noop; - this.fire('destroy'); - this.set = this.get = noop; - - if (detach !== false) this._fragment.u(); - this._fragment.d(); - this._fragment = this._state = null; - } - - function get(key) { - return key ? this._state[key] : this._state; - } - - function fire(eventName, data) { - var handlers = eventName in this._handlers && this._handlers[eventName].slice(); - if (!handlers) return; - - for (var i = 0; i < handlers.length; i += 1) { - handlers[i].call(this, data); - } - } - - function observe(key, callback, options) { - var group = options && options.defer ? this._observers.post : this._observers.pre; - - (group[key] || (group[key] = [])).push(callback); - - if (!options || options.init !== false) { - callback.__calling = true; - callback.call(this, this._state[key]); - callback.__calling = false; - } - - return { - cancel: function cancel() { - var index = group[key].indexOf(callback); - if (~index) group[key].splice(index, 1); - } - }; - } - - function on(eventName, handler) { - if (eventName === 'teardown') return this.on('destroy', handler); - - var handlers = this._handlers[eventName] || (this._handlers[eventName] = []); - handlers.push(handler); - - return { - cancel: function cancel() { - var index = handlers.indexOf(handler); - if (~index) handlers.splice(index, 1); - } - }; - } - - function set(newState) { - this._set(assign({}, newState)); - if (this.root._lock) return; - this.root._lock = true; - callAll(this.root._beforecreate); - callAll(this.root._oncreate); - callAll(this.root._aftercreate); - this.root._lock = false; - } - - function _set(newState) { - var oldState = this._state, - changed = {}, - dirty = false; - - for (var key in newState) { - if (differs(newState[key], oldState[key])) changed[key] = dirty = true; - } - if (!dirty) return; - - this._state = assign({}, oldState, newState); - this._recompute(changed, this._state); - if (this._bind) this._bind(changed, this._state); - - if (this._fragment) { - dispatchObservers(this, this._observers.pre, changed, this._state, oldState); - this._fragment.p(changed, this._state); - dispatchObservers(this, this._observers.post, changed, this._state, oldState); - } - } - - function _mount(target, anchor) { - this._fragment.m(target, anchor); - } - - function _unmount() { - if (this._fragment) this._fragment.u(); - } - - function differs(a, b) { - return a !== b || a && (typeof a === "undefined" ? "undefined" : _typeof(a)) === 'object' || typeof a === 'function'; - } - - function blankObject() { - return Object.create(null); - } - - function dispatchObservers(component, group, changed, newState, oldState) { - for (var key in group) { - if (!changed[key]) continue; - - var newValue = newState[key]; - var oldValue = oldState[key]; - - var callbacks = group[key]; - if (!callbacks) continue; - - for (var i = 0; i < callbacks.length; i += 1) { - var callback = callbacks[i]; - if (callback.__calling) continue; - - callback.__calling = true; - callback.call(component, newValue, oldValue); - callback.__calling = false; - } - } - } - exports.default = ValueEditor; -}); diff --git a/package-lock.json b/package-lock.json index a7e2024..1a7a27d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,234 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz", + "integrity": "sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.44" + } + }, + "@babel/generator": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz", + "integrity": "sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44", + "jsesc": "2.5.1", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz", + "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.44", + "@babel/template": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz", + "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz", + "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz", + "integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==", + "dev": true, + "requires": { + "chalk": "2.4.1", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "@babel/template": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz", + "integrity": "sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "lodash": "4.17.4" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz", + "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==", + "dev": true + } + } + }, + "@babel/traverse": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz", + "integrity": "sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/generator": "7.0.0-beta.44", + "@babel/helper-function-name": "7.0.0-beta.44", + "@babel/helper-split-export-declaration": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "debug": "3.1.0", + "globals": "11.5.0", + "invariant": "2.2.2", + "lodash": "4.17.4" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz", + "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==", + "dev": true + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "dev": true + } + } + }, + "@babel/types": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz", + "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==", + "dev": true, + "requires": { + "esutils": "2.0.2", + "lodash": "4.17.4", + "to-fast-properties": "2.0.0" + }, + "dependencies": { + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + } + } + }, + "acorn": { + "version": "5.5.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", + "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "dev": true, + "requires": { + "co": "4.6.0", + "fast-deep-equal": "1.1.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, + "ajv-keywords": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", + "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "dev": true + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==", + "dev": true + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -27,6 +255,15 @@ "normalize-path": "2.1.1" } }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "requires": { + "sprintf-js": "1.0.3" + } + }, "arr-diff": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-2.0.0.tgz", @@ -44,6 +281,31 @@ "dev": true, "optional": true }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "1.1.2", + "es-abstract": "1.11.0" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", @@ -51,6 +313,18 @@ "dev": true, "optional": true }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY=", + "dev": true + }, "async-each": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", @@ -119,6 +393,28 @@ "source-map": "0.5.7" } }, + "babel-eslint": { + "version": "8.2.3", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.3.tgz", + "integrity": "sha512-0HeSTtaXg/Em7FCUWxwOT+KeFSO1O7LuRuzhk7g+1BjwdlQGlHq4OyMi3GqGxrNfEq8jEi6Hmt5ylEQUhurgiQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/traverse": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0" + }, + "dependencies": { + "babylon": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz", + "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==", + "dev": true + } + } + }, "babel-generator": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-generator/-/babel-generator-6.26.0.tgz", @@ -302,12 +598,6 @@ "integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=", "dev": true }, - "babel-plugin-syntax-class-properties": { - "version": "6.13.0", - "resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz", - "integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=", - "dev": true - }, "babel-plugin-syntax-exponentiation-operator": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz", @@ -348,18 +638,6 @@ "babel-runtime": "6.26.0" } }, - "babel-plugin-transform-class-properties": { - "version": "6.24.1", - "resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz", - "integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=", - "dev": true, - "requires": { - "babel-helper-function-name": "6.24.1", - "babel-plugin-syntax-class-properties": "6.13.0", - "babel-runtime": "6.26.0", - "babel-template": "6.26.0" - } - }, "babel-plugin-transform-es2015-arrow-functions": { "version": "6.22.0", "resolved": "https://registry.npmjs.org/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz", @@ -822,6 +1100,33 @@ "electron-to-chromium": "1.3.31" } }, + "buffer-from": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", + "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", + "dev": true + }, + "builtin-modules": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", + "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "dev": true + }, + "caller-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/caller-path/-/caller-path-0.1.0.tgz", + "integrity": "sha1-lAhe9jWB7NPaqSREqP6U6CV3dR8=", + "dev": true, + "requires": { + "callsites": "0.2.0" + } + }, + "callsites": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-0.2.0.tgz", + "integrity": "sha1-r6uWJikQp/M8GaV3WCXGnzTjUMo=", + "dev": true + }, "caniuse-lite": { "version": "1.0.30000792", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000792.tgz", @@ -841,6 +1146,12 @@ "supports-color": "2.0.0" } }, + "chardet": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.4.2.tgz", + "integrity": "sha1-tUc7M9yXxCTl2Y3IfVXU2KKci/I=", + "dev": true + }, "chokidar": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-1.7.0.tgz", @@ -859,6 +1170,48 @@ "readdirp": "2.1.0" } }, + "circular-json": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/circular-json/-/circular-json-0.3.3.tgz", + "integrity": "sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==", + "dev": true + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true + }, + "color-convert": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", + "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "commander": { "version": "2.13.0", "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", @@ -871,6 +1224,24 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "requires": { + "buffer-from": "1.0.0", + "inherits": "2.0.3", + "readable-stream": "2.3.3", + "typedarray": "0.0.6" + } + }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, "convert-source-map": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", @@ -887,8 +1258,18 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, - "optional": true + "requires": { + "lru-cache": "4.1.3", + "shebang-command": "1.2.0", + "which": "1.3.0" + } }, "debug": { "version": "2.6.9", @@ -899,6 +1280,37 @@ "ms": "2.0.0" } }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "dev": true, + "requires": { + "foreach": "2.0.5", + "object-keys": "1.0.11" + } + }, + "del": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/del/-/del-2.2.2.tgz", + "integrity": "sha1-wSyYHQZ4RshLyvhiz/kw2Qf/0ag=", + "dev": true, + "requires": { + "globby": "5.0.0", + "is-path-cwd": "1.0.0", + "is-path-in-cwd": "1.0.1", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1", + "rimraf": "2.6.2" + } + }, "detect-indent": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-4.0.0.tgz", @@ -908,52 +1320,493 @@ "repeating": "2.0.1" } }, - "electron-to-chromium": { - "version": "1.3.31", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.31.tgz", - "integrity": "sha512-XE4CLbswkZgZFn34cKFy1xaX+F5LHxeDLjY1+rsK9asDzknhbrd9g/n/01/acbU25KTsUSiLKwvlLyA+6XLUOA==", - "dev": true + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true + "dom-serializer": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-0.1.0.tgz", + "integrity": "sha1-BzxpdUbOB4DOI75KKOKT5AvDDII=", + "dev": true, + "requires": { + "domelementtype": "1.1.3", + "entities": "1.1.1" + }, + "dependencies": { + "domelementtype": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.1.3.tgz", + "integrity": "sha1-vSh3PiZCiBrsUVRJJCmcXNgiGFs=", + "dev": true + } + } }, - "esutils": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", - "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "domelementtype": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-1.3.0.tgz", + "integrity": "sha1-sXrtguirWeUt2cGbF1bg/BhyBMI=", "dev": true }, - "expand-brackets": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", - "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "domhandler": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-2.4.1.tgz", + "integrity": "sha1-iS5HAAqZvlW783dP/qBWHYh5wlk=", "dev": true, - "optional": true, "requires": { - "is-posix-bracket": "0.1.1" + "domelementtype": "1.3.0" } }, - "expand-range": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", - "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "domutils": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-1.7.0.tgz", + "integrity": "sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg==", "dev": true, - "optional": true, "requires": { - "fill-range": "2.2.3" + "dom-serializer": "0.1.0", + "domelementtype": "1.3.0" } }, - "extglob": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", - "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "electron-to-chromium": { + "version": "1.3.31", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.31.tgz", + "integrity": "sha512-XE4CLbswkZgZFn34cKFy1xaX+F5LHxeDLjY1+rsK9asDzknhbrd9g/n/01/acbU25KTsUSiLKwvlLyA+6XLUOA==", + "dev": true + }, + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", "dev": true, - "optional": true, "requires": { - "is-extglob": "1.0.0" + "iconv-lite": "0.4.23" + } + }, + "entities": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.1.tgz", + "integrity": "sha1-blwtClYhtdra7O+AuQ7ftc13cvA=", + "dev": true + }, + "error-ex": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", + "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.11.0.tgz", + "integrity": "sha512-ZnQrE/lXTTQ39ulXZ+J1DTFazV9qBy61x2bY071B+qGco8Z8q1QddsLdt/EF8Ai9hcWH72dWS0kFqXLxOxqslA==", + "dev": true, + "requires": { + "es-to-primitive": "1.1.1", + "function-bind": "1.1.1", + "has": "1.0.1", + "is-callable": "1.1.3", + "is-regex": "1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "dev": true, + "requires": { + "is-callable": "1.1.3", + "is-date-object": "1.0.1", + "is-symbol": "1.0.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + }, + "eslint": { + "version": "4.19.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", + "integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "babel-code-frame": "6.26.0", + "chalk": "2.4.1", + "concat-stream": "1.6.2", + "cross-spawn": "5.1.0", + "debug": "3.1.0", + "doctrine": "2.1.0", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0", + "espree": "3.5.4", + "esquery": "1.0.1", + "esutils": "2.0.2", + "file-entry-cache": "2.0.0", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.2", + "globals": "11.5.0", + "ignore": "3.3.8", + "imurmurhash": "0.1.4", + "inquirer": "3.3.0", + "is-resolvable": "1.1.0", + "js-yaml": "3.11.0", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "pluralize": "7.0.0", + "progress": "2.0.0", + "regexpp": "1.1.0", + "require-uncached": "1.0.3", + "semver": "5.5.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "4.0.2", + "text-table": "0.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "eslint-config-semistandard": { + "version": "12.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-semistandard/-/eslint-config-semistandard-12.0.1.tgz", + "integrity": "sha512-4zaPW5uRFasf2uRZkE19Y+W84KBV3q+oyWYOsgUN+5DQXE5HCsh7ZxeWDXxozk7NPycGm0kXcsJzLe5GZ1jCeg==", + "dev": true + }, + "eslint-config-standard": { + "version": "11.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-11.0.0.tgz", + "integrity": "sha512-oDdENzpViEe5fwuRCWla7AXQd++/oyIp8zP+iP9jiUPG6NBj3SHgdgtl/kTn00AjeN+1HNvavTKmYbMo+xMOlw==", + "dev": true + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "2.6.9", + "resolve": "1.7.1" + } + }, + "eslint-module-utils": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.2.0.tgz", + "integrity": "sha1-snA2LNiLGkitMIl2zn+lTphBF0Y=", + "dev": true, + "requires": { + "debug": "2.6.9", + "pkg-dir": "1.0.0" + } + }, + "eslint-plugin-html": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-4.0.3.tgz", + "integrity": "sha512-ArFnlfQxwYSz/CP0zvk8Cy3MUhcDpT3o6jgO8eKD/b8ezcLVBrgkYzmMv+7S/ya+Yl9pN+Cz2tsgYp/zElkQzA==", + "dev": true, + "requires": { + "htmlparser2": "3.9.2" + } + }, + "eslint-plugin-import": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.11.0.tgz", + "integrity": "sha1-Fa7qN6Z0mdhI6OmBgG1GJ7VQOBY=", + "dev": true, + "requires": { + "contains-path": "0.1.0", + "debug": "2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "0.3.2", + "eslint-module-utils": "2.2.0", + "has": "1.0.1", + "lodash": "4.17.4", + "minimatch": "3.0.4", + "read-pkg-up": "2.0.0", + "resolve": "1.7.1" + }, + "dependencies": { + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + } + } + }, + "eslint-plugin-node": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-6.0.1.tgz", + "integrity": "sha512-Q/Cc2sW1OAISDS+Ji6lZS2KV4b7ueA/WydVWd1BECTQwVvfQy5JAi3glhINoKzoMnfnuRgNP+ZWKrGAbp3QDxw==", + "dev": true, + "requires": { + "ignore": "3.3.8", + "minimatch": "3.0.4", + "resolve": "1.7.1", + "semver": "5.5.0" + } + }, + "eslint-plugin-promise": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.7.0.tgz", + "integrity": "sha512-2WO+ZFh7vxUKRfR0cOIMrWgYKdR6S1AlOezw6pC52B6oYpd5WFghN+QHxvrRdZMtbo8h3dfUZ2o1rWb0UPbKtg==", + "dev": true + }, + "eslint-plugin-react": { + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz", + "integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==", + "dev": true, + "requires": { + "doctrine": "2.1.0", + "has": "1.0.1", + "jsx-ast-utils": "2.0.1", + "prop-types": "15.6.1" + } + }, + "eslint-plugin-standard": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-standard/-/eslint-plugin-standard-3.1.0.tgz", + "integrity": "sha512-fVcdyuKRr0EZ4fjWl3c+gp1BANFJD1+RaWa2UPYfMZ6jCtp5RG00kSaXnK/dE5sYzt4kaWJ9qdxqUfc0d9kX0w==", + "dev": true + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.5.3", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", + "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", + "dev": true + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "expand-brackets": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-0.1.5.tgz", + "integrity": "sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=", + "dev": true, + "optional": true, + "requires": { + "is-posix-bracket": "0.1.1" + } + }, + "expand-range": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", + "dev": true, + "optional": true, + "requires": { + "fill-range": "2.2.3" + } + }, + "external-editor": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-2.2.0.tgz", + "integrity": "sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A==", + "dev": true, + "requires": { + "chardet": "0.4.2", + "iconv-lite": "0.4.23", + "tmp": "0.0.33" + } + }, + "extglob": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-0.3.2.tgz", + "integrity": "sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "1.0.0" + } + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "fbjs": { + "version": "0.8.16", + "resolved": "https://registry.npmjs.org/fbjs/-/fbjs-0.8.16.tgz", + "integrity": "sha1-XmdDL1UNxBtXK/VYR7ispk5TN9s=", + "dev": true, + "requires": { + "core-js": "1.2.7", + "isomorphic-fetch": "2.2.1", + "loose-envify": "1.3.1", + "object-assign": "4.1.1", + "promise": "7.3.1", + "setimmediate": "1.0.5", + "ua-parser-js": "0.7.18" + }, + "dependencies": { + "core-js": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-1.2.7.tgz", + "integrity": "sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY=", + "dev": true + } + } + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-2.0.0.tgz", + "integrity": "sha1-w5KZDD5oR4PYOLjISkXYoEhFg2E=", + "dev": true, + "requires": { + "flat-cache": "1.3.0", + "object-assign": "4.1.1" } }, "filename-regex": { @@ -977,6 +1830,28 @@ "repeat-string": "1.6.1" } }, + "find-up": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz", + "integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=", + "dev": true, + "requires": { + "path-exists": "2.1.0", + "pinkie-promise": "2.0.1" + } + }, + "flat-cache": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.0.tgz", + "integrity": "sha1-0wMLMrOBVPTjt+nHCfSQ9++XxIE=", + "dev": true, + "requires": { + "circular-json": "0.3.3", + "del": "2.2.2", + "graceful-fs": "4.1.11", + "write": "0.2.1" + } + }, "for-in": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", @@ -994,6 +1869,12 @@ "for-in": "1.0.2" } }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=", + "dev": true + }, "fs-readdir-recursive": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", @@ -1910,6 +2791,18 @@ } } }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -1950,12 +2843,35 @@ "integrity": "sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==", "dev": true }, + "globby": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-5.0.0.tgz", + "integrity": "sha1-69hGZ8oNuzMLmbz8aOrCvFQ3Dg0=", + "dev": true, + "requires": { + "array-union": "1.0.2", + "arrify": "1.0.1", + "glob": "7.1.2", + "object-assign": "4.1.1", + "pify": "2.3.0", + "pinkie-promise": "2.0.1" + } + }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", "dev": true }, + "has": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.1.tgz", + "integrity": "sha1-hGFzP1OLCDfJNh45qauelwTcLyg=", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, "has-ansi": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", @@ -1965,6 +2881,12 @@ "ansi-regex": "2.1.1" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "home-or-tmp": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/home-or-tmp/-/home-or-tmp-2.0.0.tgz", @@ -1975,6 +2897,47 @@ "os-tmpdir": "1.0.2" } }, + "hosted-git-info": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", + "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "dev": true + }, + "htmlparser2": { + "version": "3.9.2", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-3.9.2.tgz", + "integrity": "sha1-G9+HrMoPP55T+k/M6w9LTLsAszg=", + "dev": true, + "requires": { + "domelementtype": "1.3.0", + "domhandler": "2.4.1", + "domutils": "1.7.0", + "entities": "1.1.1", + "inherits": "2.0.3", + "readable-stream": "2.3.3" + } + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-3.3.8.tgz", + "integrity": "sha512-pUh+xUQQhQzevjRHHFqqcTy0/dP/kS9I8HSrUydhihjuD09W6ldVWFtIrwhXdUJHis3i2rZNqEHpZH/cbinFbg==", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -1991,14 +2954,88 @@ "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", "dev": true }, - "invariant": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", - "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "inquirer": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", + "integrity": "sha512-h+xtnyk4EwKvFWHrUYsWErEVR+igKtLdchu+o0Z1RL7VU/jVMFbYir2bp6bAj8efFNxWqHX0dIss6fJQ+/+qeQ==", "dev": true, "requires": { - "loose-envify": "1.3.1" - } + "ansi-escapes": "3.1.0", + "chalk": "2.4.1", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "2.2.0", + "figures": "2.0.0", + "lodash": "4.17.4", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rx-lite": "4.0.8", + "rx-lite-aggregates": "4.0.8", + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "invariant": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.2.tgz", + "integrity": "sha1-nh9WrArNtr8wMwbzOL47IErmA2A=", + "dev": true, + "requires": { + "loose-envify": "1.3.1" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true }, "is-binary-path": { "version": "1.0.1", @@ -2016,6 +3053,27 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "is-builtin-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", + "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", + "dev": true, + "requires": { + "builtin-modules": "1.1.1" + } + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, "is-dotfile": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/is-dotfile/-/is-dotfile-1.0.3.tgz", @@ -2055,6 +3113,12 @@ "number-is-nan": "1.0.1" } }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, "is-glob": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-2.0.1.tgz", @@ -2074,6 +3138,30 @@ "kind-of": "3.2.2" } }, + "is-path-cwd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-1.0.0.tgz", + "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=", + "dev": true + }, + "is-path-in-cwd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", + "dev": true, + "requires": { + "is-path-inside": "1.0.1" + } + }, + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "1.0.2" + } + }, "is-posix-bracket": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz", @@ -2088,12 +3176,51 @@ "dev": true, "optional": true }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.1" + } + }, + "is-resolvable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", "dev": true }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, "isobject": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", @@ -2104,24 +3231,65 @@ "isarray": "1.0.0" } }, + "isomorphic-fetch": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz", + "integrity": "sha1-YRrhrPFPXoH3KVB0coGf6XM1WKk=", + "dev": true, + "requires": { + "node-fetch": "1.7.3", + "whatwg-fetch": "2.0.4" + } + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", "dev": true }, + "js-yaml": { + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", + "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.0" + } + }, "jsesc": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-1.3.0.tgz", "integrity": "sha1-RsP+yMGJKxKwgz25vHYiF226s0s=", "dev": true }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=", "dev": true }, + "jsx-ast-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", + "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", + "dev": true, + "requires": { + "array-includes": "3.0.3" + } + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -2131,6 +3299,46 @@ "is-buffer": "1.1.6" } }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, "locutus": { "version": "2.0.9", "resolved": "https://registry.npmjs.org/locutus/-/locutus-2.0.9.tgz", @@ -2151,6 +3359,16 @@ "js-tokens": "3.0.2" } }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, "micromatch": { "version": "2.3.11", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-2.3.11.tgz", @@ -2173,6 +3391,12 @@ "regex-cache": "0.4.4" } }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", @@ -2203,6 +3427,12 @@ "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", "dev": true }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, "nan": { "version": "2.8.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", @@ -2210,6 +3440,34 @@ "dev": true, "optional": true }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node-fetch": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-1.7.3.tgz", + "integrity": "sha512-NhZ4CsKx7cYm2vSrBAr2PvFOe6sWDf0UYLRqA6svUYg7+/TSfVAu49jYC4BvQ4Sms9SZgdqGBgroqfDhJdTyKQ==", + "dev": true, + "requires": { + "encoding": "0.1.12", + "is-stream": "1.1.0" + } + }, + "normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "dev": true, + "requires": { + "hosted-git-info": "2.6.0", + "is-builtin-module": "1.0.0", + "semver": "5.5.0", + "validate-npm-package-license": "3.0.3" + } + }, "normalize-path": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", @@ -2231,6 +3489,12 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=", + "dev": true + }, "object.omit": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/object.omit/-/object.omit-2.0.1.tgz", @@ -2251,6 +3515,29 @@ "wrappy": "1.0.2" } }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, "os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -2274,6 +3561,30 @@ "object-assign": "4.1.1" } }, + "p-limit": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", + "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.2.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -2287,12 +3598,93 @@ "is-glob": "2.0.1" } }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.1" + } + }, + "path-exists": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz", + "integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=", + "dev": true, + "requires": { + "pinkie-promise": "2.0.1" + } + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "dev": true }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "2.0.4" + } + }, + "pkg-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-1.0.0.tgz", + "integrity": "sha1-ektQio1bstYp1EcFb/TpyTFM89Q=", + "dev": true, + "requires": { + "find-up": "1.1.2" + } + }, + "pluralize": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", + "integrity": "sha512-ARhBOdzS3e41FbkW/XWrTEtukqqLoK5+Z/4UeDaLuSW+39JPeFgs4gCGqsrJHVZX0fUrx//4OF0K1CUGwlIFow==", + "dev": true + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, "preserve": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/preserve/-/preserve-0.2.0.tgz", @@ -2310,8 +3702,39 @@ "version": "1.0.7", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", "integrity": "sha1-FQ4gt1ZZCtP5EJPyWk8q2L/zC6M=", + "dev": true + }, + "progress": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.0.tgz", + "integrity": "sha1-ihvjZr+Pwj2yvSPxDG/pILQ4nR8=", + "dev": true + }, + "promise": { + "version": "7.3.1", + "resolved": "https://registry.npmjs.org/promise/-/promise-7.3.1.tgz", + "integrity": "sha512-nolQXZ/4L+bP/UGlkfaIujX9BKxGwmQ9OT4mOt5yvy8iK1h3wqTEJCijzGANTCCl9nWjY41juyAn2K3Q1hLLTg==", "dev": true, - "optional": true + "requires": { + "asap": "2.0.6" + } + }, + "prop-types": { + "version": "15.6.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.1.tgz", + "integrity": "sha512-4ec7bY1Y66LymSUOH/zARVYObB23AT2h8cf6e/O6ZALB/N0sqZFEx7rq6EYPX2MkOdKORuooI/H5k9TlR4q7kQ==", + "dev": true, + "requires": { + "fbjs": "0.8.16", + "loose-envify": "1.3.1", + "object-assign": "4.1.1" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true }, "randomatic": { "version": "1.1.7", @@ -2358,12 +3781,43 @@ } } }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, + "requires": { + "load-json-file": "2.0.0", + "normalize-package-data": "2.4.0", + "path-type": "2.0.0" + } + }, + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + }, + "dependencies": { + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + } + } + }, "readable-stream": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.3.tgz", "integrity": "sha512-m+qzzcn7KUxEmd1gMbchF+Y2eIUbieUaxkWtptyHywrX0rE8QEYqPC07Vuy4Wm32/xE16NcdBctb8S0Xe/5IeQ==", "dev": true, - "optional": true, "requires": { "core-util-is": "1.0.2", "inherits": "2.0.3", @@ -2420,6 +3874,12 @@ "is-equal-shallow": "0.1.3" } }, + "regexpp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", + "integrity": "sha512-LOPw8FpgdQF9etWMaAfG/WRthIdXJGYp4mJ2Jgn/2lpkbod9jPn0t9UqN7AxBOKNfzRbYyVfgc7Vk4t/MpnXgw==", + "dev": true + }, "regexpu-core": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-2.0.0.tgz", @@ -2482,12 +3942,86 @@ "is-finite": "1.0.2" } }, + "require-uncached": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/require-uncached/-/require-uncached-1.0.3.tgz", + "integrity": "sha1-Tg1W1slmL9MeQwEcS5WqSZVUIdM=", + "dev": true, + "requires": { + "caller-path": "0.1.0", + "resolve-from": "1.0.1" + } + }, + "resolve": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", + "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "dev": true, + "requires": { + "path-parse": "1.0.5" + } + }, + "resolve-from": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-1.0.1.tgz", + "integrity": "sha1-Jsv+k10a7uq7Kbw/5a6wHpPUQiY=", + "dev": true + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "dev": true, + "requires": { + "onetime": "2.0.1", + "signal-exit": "3.0.2" + } + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } + }, + "rx-lite": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite/-/rx-lite-4.0.8.tgz", + "integrity": "sha1-Cx4Rr4vESDbwSmQH6S2kJGe3lEQ=", + "dev": true + }, + "rx-lite-aggregates": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz", + "integrity": "sha1-dTuHqJoRyVRnxKwWJsTvxOBcZ74=", + "dev": true, + "requires": { + "rx-lite": "4.0.8" + } + }, "safe-buffer": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==", "dev": true }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "semver": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", @@ -2501,12 +4035,48 @@ "dev": true, "optional": true }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, "slash": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=", "dev": true }, + "slice-ansi": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-1.0.0.tgz", + "integrity": "sha512-POqxBK6Lb3q6s047D/XsDVNPnF9Dl8JSaqe9h9lURl0OdNqy/ujDrOiIHtsqXMGbWWTIomRzAMaTyawAU//Reg==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0" + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", @@ -2522,12 +4092,76 @@ "source-map": "0.5.7" } }, + "spdx-correct": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", + "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-exceptions": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", + "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.1.0", + "spdx-license-ids": "3.0.0" + } + }, + "spdx-license-ids": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", + "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "dev": true + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + } + } + }, "string_decoder": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", "dev": true, - "optional": true, "requires": { "safe-buffer": "5.1.1" } @@ -2541,6 +4175,18 @@ "ansi-regex": "2.1.1" } }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "dev": true + }, "supports-color": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", @@ -2548,18 +4194,84 @@ "dev": true }, "svelte": { - "version": "1.51.1", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-1.51.1.tgz", - "integrity": "sha512-Uf9huHmtXLzdmkfuEYQeXMvFE9dt8M9/jzujX3/Q2Ek2dzvVz1ARTLP76hlnGqUf4q28w8wfkQxFEx4LgDV5MQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-2.5.0.tgz", + "integrity": "sha512-N4Tif7+KK2NGk0FJf8JWp5zaBt6/w0V0bzFOlWGehqVsso+T7lxwjwBsIVgwolZDYTiGdrmrr18U04zx1toAmg==", "dev": true }, "svelte-cli": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/svelte-cli/-/svelte-cli-2.1.0.tgz", - "integrity": "sha512-C++QVJ7CCJ+Zx/SEMsOcNqOIstr48bBqMyGZwA2DtKP3+PxzGBkJOidYWhlMp0lHr2gBQ6RFGfEnCs7WfXOS5w==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/svelte-cli/-/svelte-cli-3.0.0.tgz", + "integrity": "sha512-gVoro8uGfE2G3kigs8fQt6XyFRMxYRiKlMs6wgHqhNMkE0MQu47SxQmSc1lTzPq9XY/TJHLV3dbTkyZ9PLXy1A==", + "dev": true, + "requires": { + "svelte": "2.5.0" + } + }, + "table": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", + "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "dev": true, + "requires": { + "ajv": "5.5.2", + "ajv-keywords": "2.1.1", + "chalk": "2.4.1", + "lodash": "4.17.4", + "slice-ansi": "1.0.0", + "string-width": "2.1.1" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.1" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { - "svelte": "1.51.1" + "os-tmpdir": "1.0.2" } }, "to-fast-properties": { @@ -2574,6 +4286,27 @@ "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", "dev": true }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=", + "dev": true + }, + "ua-parser-js": { + "version": "0.7.18", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.18.tgz", + "integrity": "sha512-LtzwHlVHwFGTptfNSgezHp7WUlwiqb0gA9AALRbKaERfxwJoiX0A73QbTToxteIAuIaFshhgIZfqK8s7clqgnA==", + "dev": true + }, "user-home": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/user-home/-/user-home-1.1.1.tgz", @@ -2584,8 +4317,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", - "dev": true, - "optional": true + "dev": true }, "v8flags": { "version": "2.1.1", @@ -2596,11 +4328,57 @@ "user-home": "1.1.1" } }, + "validate-npm-package-license": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", + "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "dev": true, + "requires": { + "spdx-correct": "3.0.0", + "spdx-expression-parse": "3.0.0" + } + }, + "whatwg-fetch": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz", + "integrity": "sha512-dcQ1GWpOD/eEQ97k66aiEVpNnapVj90/+R+SXTPYGHpYBBypfKJEQjLrvMZ7YXbKm21gXd4NcuxUTjiv1YtLng==", + "dev": true + }, + "which": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", + "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "write": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/write/-/write-0.2.1.tgz", + "integrity": "sha1-X8A4KOJkzqP+kUVUdvejxWbLB1c=", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true } } } diff --git a/package.json b/package.json index a8ae80f..cba2537 100644 --- a/package.json +++ b/package.json @@ -2,16 +2,18 @@ "name": "nymph-query-editor", "version": "1.1.4", "description": "A Nymph query editor built with Svelte.", + "main": "lib/umd/QueryEditor.js", + "browser": "lib/es/QueryEditor.js", "directories": { - "lib": "lib" + "lib": "lib/umd" }, "scripts": { - "build": "npm run build-QueryEditor && npm run build-SelectorEditor && npm run build-ValueEditor", - "build-QueryEditor": "svelte compile --format es src/QueryEditor.html > lib/QueryEditor.js && babel lib/QueryEditor.js -o lib/QueryEditor.js", - "build-SelectorEditor": "svelte compile --format es src/SelectorEditor.html > lib/SelectorEditor.js && babel lib/SelectorEditor.js -o lib/SelectorEditor.js", - "build-ValueEditor": "svelte compile --format es src/ValueEditor.html > lib/ValueEditor.js && babel lib/ValueEditor.js -o lib/ValueEditor.js", - "prepare": "npm run build", - "test": "echo \"Error: no test specified\" && exit 1" + "build": "npm run compile && npm run transpile", + "compile": "svelte compile src/ -o lib/es/", + "transpile": "babel -d lib/umd/ lib/es/", + "prepare": "npm run lint && npm run build", + "test": "echo \"Error: no test specified\" && exit 1", + "lint": "eslint src/*.html" }, "repository": { "type": "git", @@ -28,12 +30,21 @@ "homepage": "https://github.com/sciactive/nymph-query-editor#readme", "devDependencies": { "babel-cli": "^6.26.0", - "babel-plugin-transform-class-properties": "^6.24.1", + "babel-eslint": "^8.2.3", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "babel-preset-env": "^1.6.1", "babel-preset-stage-3": "^6.24.1", - "svelte": "^1.51.1", - "svelte-cli": "^2.1.0" + "eslint": "^4.19.1", + "eslint-config-semistandard": "^12.0.1", + "eslint-config-standard": "^11.0.0", + "eslint-plugin-html": "^4.0.3", + "eslint-plugin-import": "^2.11.0", + "eslint-plugin-node": "^6.0.1", + "eslint-plugin-promise": "^3.7.0", + "eslint-plugin-react": "^7.7.0", + "eslint-plugin-standard": "^3.1.0", + "svelte": "^2.5.0", + "svelte-cli": "^3.0.0" }, "dependencies": { "locutus": "^2.0.9" diff --git a/src/QueryEditor.html b/src/QueryEditor.html index 97b810d..8dabb35 100644 --- a/src/QueryEditor.html +++ b/src/QueryEditor.html @@ -1,319 +1,89 @@