From 31c337b3aef03a21d4984f3213fedc2daad59e94 Mon Sep 17 00:00:00 2001 From: Jason Laster Date: Thu, 20 Jul 2017 20:08:00 -0400 Subject: [PATCH] Bug 1382432 - Update debugger frontend (v0.8.0). r=jdescottes --- devtools/client/debugger/new/debugger.css | 749 +- devtools/client/debugger/new/debugger.js | 8233 ++++++++++------- devtools/client/debugger/new/parser-worker.js | 390 +- .../debugger/new/pretty-print-worker.js | 15 +- devtools/client/debugger/new/search-worker.js | 123 +- .../browser_dbg-breaking-from-console.js | 10 +- .../mochitest/browser_dbg-breakpoints-cond.js | 2 + .../browser_dbg-breakpoints-reloading.js | 1 + .../test/mochitest/browser_dbg-breakpoints.js | 21 +- .../mochitest/browser_dbg-editor-select.js | 2 +- .../test/mochitest/browser_dbg-sourcemaps.js | 51 +- .../test/mochitest/browser_dbg-sourcemaps2.js | 2 +- .../client/locales/en-US/debugger.properties | 4 + devtools/client/preferences/debugger.js | 2 +- 14 files changed, 6243 insertions(+), 3362 deletions(-) diff --git a/devtools/client/debugger/new/debugger.css b/devtools/client/debugger/new/debugger.css index 9c30cadec78c..3a8d26402775 100644 --- a/devtools/client/debugger/new/debugger.css +++ b/devtools/client/debugger/new/debugger.css @@ -356,11 +356,13 @@ body { :root.theme-dark .CodeMirror-scrollbar-filler { background: transparent; } -:root.theme-light, :root .theme-light { +:root.theme-light, +:root .theme-light { --search-overlays-semitransparent: rgba(221, 225, 228, 0.66); } -:root.theme-dark, :root .theme-dark { +:root.theme-dark, +:root .theme-dark { --search-overlays-semitransparent: rgba(42, 46, 56, 0.66); } .debugger { @@ -461,7 +463,8 @@ menuseparator { * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -.theme-dark, .theme-light { +.theme-dark, +.theme-light { --number-color: var(--theme-highlight-green); --string-color: var(--theme-highlight-orange); --null-color: var(--theme-comment); @@ -475,7 +478,7 @@ menuseparator { .theme-firebug { --number-color: #000088; - --string-color: #FF0000; + --string-color: #ff0000; --null-color: #787878; --object-color: DarkGreen; --caption-color: #444444; @@ -503,7 +506,10 @@ menuseparator { white-space: pre-wrap; } -.objectBox-string, .objectBox-text, .objectLink-textNode, .objectBox-table { +.objectBox-string, +.objectBox-text, +.objectLink-textNode, +.objectBox-table { white-space: pre-wrap; } @@ -519,7 +525,9 @@ menuseparator { color: var(--string-color); } -.objectLink-function, .objectBox-stackTrace, .objectLink-profile { +.objectLink-function, +.objectBox-stackTrace, +.objectLink-profile { color: var(--object-color); } @@ -528,7 +536,10 @@ menuseparator { color: var(--location-color); } -.objectBox-null, .objectBox-undefined, .objectBox-hint, .logRowHint { +.objectBox-null, +.objectBox-undefined, +.objectBox-hint, +.logRowHint { font-style: italic; color: var(--null-color); } @@ -572,16 +583,21 @@ menuseparator { /******************************************************************************/ -.objectLeftBrace, .objectRightBrace, .arrayLeftBracket, .arrayRightBracket { +.objectLeftBrace, +.objectRightBrace, +.arrayLeftBracket, +.arrayRightBracket { cursor: pointer; font-weight: bold; } -.objectLeftBrace, .arrayLeftBracket { +.objectLeftBrace, +.arrayLeftBracket { margin-right: 4px; } -.objectRightBrace, .arrayRightBracket { +.objectRightBrace, +.arrayRightBracket { margin-left: 4px; } @@ -613,12 +629,14 @@ menuseparator { font-style: normal; } -.theme-dark .objectBox-object, .theme-light .objectBox-object { +.theme-dark .objectBox-object, +.theme-light .objectBox-object { font-weight: normal; white-space: pre-wrap; } -.theme-dark .caption, .theme-light .caption { +.theme-dark .caption, +.theme-light .caption { font-weight: normal; } /* vim:set ts=2 sw=2 sts=2 et: */ @@ -728,21 +746,36 @@ menuseparator { .theme-dark .result-list li .subtitle { color: var(--theme-comment-alt); } -.arrow, .folder, .domain, .file, .worker, .refresh, .add-button { +.arrow, +.folder, +.domain, +.file, +.worker, +.refresh, +.add-button { fill: var(--theme-splitter-color); } -.worker, .folder { +.worker, +.folder { position: relative; top: 2px; } -.domain, .file, .worker, .refresh, .add-button { +.domain, +.file, +.worker, +.refresh, +.add-button { position: relative; top: 1px; } -.domain svg, .folder svg, .worker svg, .refresh svg, .add-button svg { +.domain svg, +.folder svg, +.worker svg, +.refresh svg, +.add-button svg { width: 15px; } @@ -750,7 +783,11 @@ menuseparator { width: 13px; } -.file svg, .domain svg, .folder svg, .refresh svg, .worker svg { +.file svg, +.domain svg, +.folder svg, +.refresh svg, +.worker svg { margin-inline-end: 5px; } @@ -779,32 +816,53 @@ html .arrow.expanded svg { .arrow.hidden { visibility: hidden; } -.autocomplete { - flex: 1; - width: 100%; +.managed-tree .tree { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; + + white-space: nowrap; + overflow: auto; + min-width: 100%; } -.autocomplete .no-result-msg { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 100%; - color: var(--theme-graphs-full-red); - font-size: 24px; - padding: 4px; - word-break: break-all; +.managed-tree .tree button { + display: block; } -.autocomplete .no-result-msg .sad-face { - width: 24px; - margin: 0 4px; - line-height: 0; - flex-shrink: 0; +.managed-tree .tree .node { + padding: 2px 3px 2px 3px; + position: relative; + cursor: pointer; } -.autocomplete .no-result-msg .sad-face svg { - fill: var(--theme-graphs-full-red); +.managed-tree .tree .node.focused { + color: white; + background-color: var(--theme-selection-background); + padding-bottom: 2px; +} + +.theme-dark .managed-tree .tree .node.focused { + background-color: var(--theme-selection-background-semitransparent); + padding-bottom: 2px; +} + +html:not([dir="rtl"]) .managed-tree .tree .node > div { + margin-left: 10px; +} + +html[dir="rtl"] .managed-tree .tree .node > div { + margin-right: 10px; +} + +.managed-tree .tree .node.focused svg { + fill: white; +} + +.managed-tree .tree-node button { + position: fixed; } .close-btn path { fill: var(--theme-comment-alt); @@ -895,17 +953,20 @@ html .arrow.expanded svg { color: var(--theme-body-color-inactive); } -.search-field i.magnifying-glass, .search-field i.sad-face { +.search-field i.magnifying-glass, +.search-field i.sad-face { padding: 6px; width: 24px; } -.search-field.big i.magnifying-glass, .search-field.big i.sad-face { +.search-field.big i.magnifying-glass, +.search-field.big i.sad-face { padding: 14px; width: 40px; } -.search-field .magnifying-glass path, .search-field .magnifying-glass ellipse { +.search-field .magnifying-glass path, +.search-field .magnifying-glass ellipse { stroke: var(--theme-splitter-color); } @@ -958,9 +1019,97 @@ html .arrow.expanded svg { .search-field .search-nav-buttons .nav-btn path { fill: var(--theme-comment); } +.project-text-search { + flex-grow: 1; +} + +.project-text-search .result { + display: flex; + cursor: default; + margin-bottom: 1px; + padding: 4px 0 4px 30px; +} + +.project-text-search .matches-summary { + margin-left: 2px; +} + +.project-text-search .result.focused { + background-color: #eeeeee; +} + +.project-text-search .result .query-match { + background-color: var(--theme-selection-background); + color: white; + padding: 1px 4px; + margin: 0 2px 0 2px; + border-radius: 2px; +} + +.project-text-search .result.focused .line-number { + font-weight: bolder; +} + +.project-text-search .result .line-number { + margin-right: 1em; + width: 2em; +} + +.project-text-search .file-result { + font-weight: bold; + line-height: 20px; + cursor: default; + margin: 2px 20px 2px 0; + padding: 3px 0 3px 5px; +} + +.project-text-search .file-result .arrow { + margin: 2px 0 2px 0; +} + +.project-text-search .file-result.focused { + background-color: #eeeeee; +} + +.project-text-search .line-match { + display: "flex"; + grow: 1; +} + +.project-text-search .search-field { + display: flex; + align-self: stretch; + flex-grow: 1; +} +.autocomplete { + flex: 1; + width: 100%; +} + +.autocomplete .no-result-msg { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 100%; + color: var(--theme-graphs-full-red); + font-size: 24px; + padding: 4px; + word-break: break-all; +} + +.autocomplete .no-result-msg .sad-face { + width: 24px; + margin: 0 4px; + line-height: 0; + flex-shrink: 0; +} + +.autocomplete .no-result-msg .sad-face svg { + fill: var(--theme-graphs-full-red); +} .result-list { list-style: none; - background-color: var(--theme-toolbar-background); margin: 0px; padding: 0px; overflow: auto; @@ -978,7 +1127,6 @@ html .arrow.expanded svg { .result-list li { color: var(--theme-body-color); - background-color: var(--theme-tab-toolbar-background); padding: 4px 13px; display: flex; justify-content: space-between; @@ -1000,12 +1148,12 @@ html .arrow.expanded svg { border-color: var(--theme-selection-background); } -.search-bar .result-list li.selected { +.result-list.small li.selected { background-color: var(--theme-selection-background); color: white; } -.theme-dark .search-bar .result-list li.selected { +.theme-dark .result-list.small li.selected { background-color: var(--theme-body-background); } @@ -1042,82 +1190,6 @@ html .arrow.expanded svg { .theme-dark .result-list { background-color: var(--theme-body-background); } -.tree { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -o-user-select: none; - user-select: none; - - white-space: nowrap; - overflow: auto; - min-width: 100%; -} - -.tree button { - display: block; -} - -.tree .node { - padding: 2px 5px; - position: relative; - cursor: pointer; -} - -.tree .node.focused { - color: white; - background-color: var(--theme-selection-background); -} - -.theme-dark .tree .node.focused { - background-color: var(--theme-selection-background-semitransparent); -} - -html:not([dir="rtl"]) .tree .node > div { - margin-left: 10px; -} - -html[dir="rtl"] .tree .node > div { - margin-right: 10px; -} - -.tree .node.focused svg { - fill: white; -} - -.tree-node button { - position: fixed; -} -.project-text-search { - flex-grow: 1; -} - -.project-text-search .result { - display: flex; - margin-left: 20px; -} - -.project-text-search .file-result { - font-weight: bold; - margin-top: 20px; - line-height: 20px; -} - -.project-text-search .line-match { - font-family: monospace; - display: "flex"; - grow: 1; -} - -.project-text-search .result .line-number { - padding-right: 5px; -} - -.project-text-search .search-field { - display: flex; - align-self: stretch; - flex-grow: 1; -} .sources-panel { flex: 1; display: flex; @@ -1165,7 +1237,15 @@ html[dir="rtl"] .tree .node > div { .sources-list { flex: 1; display: flex; - overflow: hidden; + overflow-x: hidden; + overflow-y: auto; +} + +.sources-list .managed-tree { + flex: 1; + display: flex; + overflow-x: hidden; + overflow-y: auto; } .theme-dark .sources-list .tree .node:not(.focused) svg { @@ -1181,7 +1261,10 @@ html[dir="rtl"] .tree .node > div { color: var(--theme-comment-alt); font-weight: lighter; padding-top: 5px; - text-align: center; + flex-grow: 1; + display: flex; + justify-content: center; + align-items: center; } .sources-panel .source-footer { @@ -1306,23 +1389,27 @@ html[dir="rtl"] .tree .node > div { .conditional-breakpoint-panel input:focus { outline-width: 0; } -.toggle-button-start, .toggle-button-end { +.toggle-button-start, +.toggle-button-end { transform: translate(0, 2px); transition: transform 0.25s ease-in-out; cursor: pointer; padding: 5px 2px; } -.toggle-button-start.vertical, .toggle-button-end.vertical { +.toggle-button-start.vertical, +.toggle-button-end.vertical { padding: 4px 2px; } -.toggle-button-start svg, .toggle-button-end svg { +.toggle-button-start svg, +.toggle-button-end svg { width: 16px; fill: var(--theme-comment); } -.theme-dark .toggle-button-start svg, .theme-dark .toggle-button-end svg { +.theme-dark .toggle-button-start svg, +.theme-dark .toggle-button-end svg { fill: var(--theme-comment-alt); } @@ -1344,7 +1431,8 @@ html .toggle-button-end.vertical svg { transform: rotate(-90deg); } -.toggle-button-start.collapsed, .toggle-button-end.collapsed { +.toggle-button-start.collapsed, +.toggle-button-end.collapsed { transform: rotate(180deg); } .source-footer { @@ -1550,6 +1638,256 @@ html .toggle-button-end.vertical svg { .search-bar .result-list { max-height: 230px; } +/* vim:set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +.theme-dark, +.theme-light { + --number-color: var(--theme-highlight-green); + --string-color: var(--theme-highlight-orange); + --null-color: var(--theme-comment); + --object-color: var(--theme-body-color); + --caption-color: var(--theme-highlight-blue); + --location-color: var(--theme-content-color1); + --source-link-color: var(--theme-highlight-blue); + --node-color: var(--theme-highlight-bluegrey); + --reference-color: var(--theme-highlight-purple); +} + +.theme-firebug { + --number-color: #000088; + --string-color: #FF0000; + --null-color: #787878; + --object-color: DarkGreen; + --caption-color: #444444; + --location-color: #555555; + --source-link-color: blue; + --node-color: rgb(0, 0, 136); + --reference-color: rgb(102, 102, 255); +} + +/******************************************************************************/ + +.inline { + display: inline; + white-space: normal; +} + +.objectBox-object { + font-weight: bold; + color: var(--object-color); + white-space: pre-wrap; +} + +.objectBox-string, +.objectBox-symbol, +.objectBox-text, +.objectBox-textNode, +.objectBox-table { + white-space: pre-wrap; +} + +.objectBox-number, +.objectBox-styleRule, +.objectBox-element, +.objectBox-textNode, +.objectBox-array > .length { + color: var(--number-color); +} + +.objectBox-textNode, +.objectBox-string, +.objectBox-symbol { + color: var(--string-color); +} + +.objectBox-function, +.objectBox-stackTrace, +.objectBox-profile { + color: var(--object-color); +} + +.objectBox-Location { + font-style: italic; + color: var(--location-color); +} + +.objectBox-null, +.objectBox-undefined, +.objectBox-hint, +.logRowHint { + font-style: italic; + color: var(--null-color); +} + +.objectBox-sourceLink { + position: absolute; + right: 4px; + top: 2px; + padding-left: 8px; + font-weight: bold; + color: var(--source-link-color); +} + +.objectBox-failure { + color: var(--string-color); + border-width: 1px; + border-style: solid; + border-radius: 2px; + font-size: 0.8em; + padding: 0 2px; +} + +/******************************************************************************/ + +.objectBox-event, +.objectBox-eventLog, +.objectBox-regexp, +.objectBox-object, +.objectBox-Date { + font-weight: bold; + color: var(--object-color); + white-space: pre-wrap; +} + +/******************************************************************************/ + +.objectBox-object .nodeName, +.objectBox-NamedNodeMap .nodeName, +.objectBox-NamedNodeMap .objectEqual, +.objectBox-Attr .attrEqual, +.objectBox-Attr .attrTitle { + color: var(--node-color); +} + +.objectBox-object .nodeName { + font-weight: normal; +} + +/******************************************************************************/ + +.objectLeftBrace, +.objectRightBrace, +.arrayLeftBracket, +.arrayRightBracket { + color: var(--theme-highlight-blue); +} + +/******************************************************************************/ +/* Cycle reference*/ + +.objectBox-Reference { + font-weight: bold; + color: var(--reference-color); +} + +[class*="objectBox-"] > .objectTitle { + color: var(--theme-highlight-blue); + font-style: italic; +} + +.caption { + font-weight: bold; + color: var(--caption-color); +} + +/******************************************************************************/ +/* Themes */ + +.theme-dark .objectBox-null, +.theme-dark .objectBox-undefined, +.theme-light .objectBox-null, +.theme-light .objectBox-undefined { + font-style: normal; +} + +.theme-dark .objectBox-object, +.theme-light .objectBox-object { + font-weight: normal; + white-space: pre-wrap; +} + +.theme-dark .caption, +.theme-light .caption { + font-weight: normal; +} + +/******************************************************************************/ +/* Open DOMNode in inspector button */ + +.open-inspector svg { + fill: rgb(215, 215, 215); + height: 16px; + width: 16px; + margin-left: .25em; + cursor: pointer; + vertical-align: middle; +} + +.objectBox-node:hover .open-inspector svg, +.objectBox-textNode:hover .open-inspector svg, +.open-inspector svg:hover { + fill: rgb(65, 175, 230); +} +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +.tree { + overflow: auto; + display: inline-block; +} + +.tree.nowrap { + white-space: nowrap; +} + +.tree.noselect { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + -o-user-select: none; + user-select: none; +} + +.tree button { + display: block; +} + +.tree .node { + padding: 0 0.25em; + position: relative; + cursor: pointer; +} + +.tree .node.focused { + color: white; + background-color: var(--theme-selection-background); +} + +.arrow svg { + fill: var(--theme-splitter-color); + transition: transform 0.125s ease; + width: 10px; + margin-inline-end: 5px; + transform: rotate(-90deg); +} + +html[dir="rtl"] .arrow svg, +.arrow svg:dir(rtl), +.arrow svg:-moz-locale-dir(rtl) { + transform: rotate(90deg); +} + +.arrow.expanded.expanded svg { + transform: rotate(0deg); +} + +.object-label { + color: var(--theme-highlight-blue); +} .object-value .unavailable { color: var(--theme-comment); } @@ -1557,7 +1895,12 @@ html .toggle-button-end.vertical svg { position: absolute; } -.bracket-arrow::before, .bracket-arrow::after { +.bracket-arrow:hover { + cursor: pointer; +} + +.bracket-arrow::before, +.bracket-arrow::after { content: ''; height: 0; width: 0; @@ -1591,7 +1934,7 @@ html .toggle-button-end.vertical svg { .bracket-arrow.down::after { border-bottom-color: transparent; - border-top-color: var(--theme-toolbar-background); + border-top-color: var(--theme-body-background); top: -1px; } .popover { @@ -1633,10 +1976,21 @@ html .toggle-button-end.vertical svg { cursor: pointer; } -.selection, .debug-expression.selection { +.selection, +.debug-expression.selection { background-color: var(--theme-highlight-yellow); } +.theme-dark .selection, +.theme-dark .debug-expression.selection { + background-color: #743884; +} + +.theme-dark .cm-s-mozilla .selection, +.theme-dark .cm-s-mozilla .debug-expression.selection { + color: #e7ebee; +} + .selection:hover { cursor: pointer; } @@ -1710,6 +2064,53 @@ html .toggle-button-end.vertical svg { color: var(--theme-comment); cursor: pointer; } +.call-site { + background: #f0f9ff; + cursor: pointer; + position: relative; +} + +.call-site::before { + content: ""; + position: absolute; + width: 100%; + height: calc(100% - 2px); + border-bottom: 2px solid #aed3ef; +} + +.call-site-bp { + cursor: pointer; + position: relative; +} + +.debug-expression.call-site-bp, +.call-site-bp { + background-color: #fce7e7; +} + +.call-site-bp::before { + content: ""; + position: absolute; + width: 100%; + height: calc(100% - 2px); + border-bottom: 2px solid red; +} + +.theme-dark .call-site { + background-color: #4b5462; +} + +.theme-dark .call-site::before { + border-bottom-color: #5f78a4; +} + +.theme-dark .call-site-bp { + background-color: #4b3f3f; +} + +.theme-dark .call-site-bp::before { + border-bottom-color: #dd4d4d; +} .editor-wrapper { --debug-line-border: rgb(145, 188, 219); --debug-expression-background: rgba(202, 227, 255, 0.5); @@ -1718,8 +2119,8 @@ html .toggle-button-end.vertical svg { } .theme-dark .editor-wrapper { - --debug-expression-background: rgb(73, 82, 103); - --debug-line-border: rgb(119, 134, 162); + --debug-expression-background: #54617e; + --debug-line-border: #7786a2; } .editor-wrapper .CodeMirror-linewidget { @@ -1734,11 +2135,13 @@ html .toggle-button-end.vertical svg { --theme-conditional-breakpoint-color: #ccd1d5; } -.paused .in-scope .CodeMirror-line, .paused .in-scope .CodeMirror-linenumber { +.paused .in-scope .CodeMirror-line, +.paused .in-scope .CodeMirror-linenumber { opacity: 1; } -.paused .CodeMirror-line, .paused .CodeMirror-linenumber { +.paused .CodeMirror-line, +.paused .CodeMirror-linenumber { opacity: 0.7; } @@ -1865,7 +2268,6 @@ html[dir="rtl"] .editor-mount { .editor-wrapper .CodeMirror-line { font-size: 11px; - line-height: 14px; } .theme-dark .editor-wrapper .CodeMirror-line .cm-comment { @@ -2053,7 +2455,8 @@ html .breakpoints-list .breakpoint.paused { order: 3; } -:root.theme-light .breakpoint-snippet, :root.theme-firebug .breakpoint-snippet { +:root.theme-light .breakpoint-snippet, +:root.theme-firebug .breakpoint-snippet { color: var(--theme-comment); } @@ -2166,7 +2569,8 @@ html .breakpoints-list .breakpoint.paused { .expression-error { color: var(--theme-highlight-red); } -.frames ul .frames-group .group, .frames ul .frames-group .group .location { +.frames ul .frames-group .group, +.frames ul .frames-group .group .location { font-weight: 500; } @@ -2252,7 +2656,8 @@ html .breakpoints-list .breakpoint.paused { margin: 0; } -:root.theme-light .frames .location, :root.theme-firebug .frames .location { +:root.theme-light .frames .location, +:root.theme-firebug .frames .location { color: var(--theme-comment); } @@ -2267,12 +2672,14 @@ html .breakpoints-list .breakpoint.paused { margin-right: 1em; } -.frames ul li:hover, .frames ul li:focus { +.frames ul li:hover, +.frames ul li:focus { background-color: var(--theme-toolbar-background-alt); outline: none; } -.theme-dark .frames ul li:hover, .theme-dark .frames ul li:focus { +.theme-dark .frames ul li:hover, +.theme-dark .frames ul li:focus { background-color: var(--theme-tab-toolbar-background); } @@ -2394,7 +2801,8 @@ html .breakpoints-list .breakpoint.paused { background-color: var(--theme-toolbar-background-hover); } -.accordion ._header button svg, .accordion ._header:hover button svg { +.accordion ._header button svg, +.accordion ._header:hover button svg { fill: currentColor; height: 16px; } @@ -2533,8 +2941,8 @@ html .command-bar > button:disabled { white-space: nowrap; } -.scopes-list .tree-node { - overflow: hidden; +.scopes-pane { + overflow: auto; } .scopes-list .function-signature { @@ -2547,14 +2955,7 @@ html .command-bar > button:disabled { white-space: nowrap; } -.secondary-panes * { - -moz-user-select: none; - user-select: none; -} - .secondary-panes .accordion { - overflow-y: auto; - overflow-x: hidden; flex: 1 0 auto; } @@ -2660,7 +3061,8 @@ html .welcomebox .toggle-button-end.collapsed { border-bottom-color: transparent; } -.source-tab.active path, .source-tab:hover path { +.source-tab.active path, +.source-tab:hover path { fill: var(--theme-body-color); } @@ -2677,7 +3079,8 @@ html .welcomebox .toggle-button-end.collapsed { fill: var(--theme-textbox-box-shadow); } -.source-tab .blackBox, .source-tab .prettyPrint { +.source-tab .blackBox, +.source-tab .prettyPrint { line-height: 0; align-self: center; } @@ -2779,3 +3182,45 @@ html[dir="rtl"] .dropdown { left: 0; top: 0; } +.symbol-modal-wrapper { + position: fixed; + width: 100%; + height: 100%; + z-index: 9; +} + +.symbol-modal { + position: absolute; + left: calc(50% - 250px); + z-index: 10; + width: 500px; + height: 230px; + background-color: var(--theme-codemirror-gutter-background); + box-shadow: 2px 4px 6px #dde1e4; + top: 30px; +} + +.symbol-modal .input-wrapper { + display: -webkit-box; + display: -ms-flexbox; + display: flex; + -webkit-box-pack: center; + -ms-flex-pack: center; + justify-content: center; +} + +.symbol-modal .close-btn { + padding: 6px; +} + +.symbol-modal .result-list { + height: calc(100% - 28px); + overflow-y: auto; +} + +@media (max-width: 520px) { + .symbol-modal { + width: 80%; + left: 10%; + } +} diff --git a/devtools/client/debugger/new/debugger.js b/devtools/client/debugger/new/debugger.js index d2c96e9471b7..05567e79637a 100644 --- a/devtools/client/debugger/new/debugger.js +++ b/devtools/client/debugger/new/debugger.js @@ -3271,7 +3271,7 @@ return /******/ (function(modules) { // webpackBootstrap var getTabs = (() => { var _ref4 = _asyncToGenerator(function* (actions) { - var firefoxTabs = yield firefox.getTabs(); + var firefoxTabs = yield firefox.connectClient(); var chromeTabs = yield chrome.connectClient(); var nodeTabs = yield chrome.connectNodeClient(); @@ -3346,7 +3346,7 @@ return /******/ (function(modules) { // webpackBootstrap var L10N = __webpack_require__(185); - var _require6 = __webpack_require__(966), + var _require6 = __webpack_require__(1130), showMenu = _require6.showMenu, buildMenu = _require6.buildMenu; @@ -11695,7 +11695,7 @@ return /******/ (function(modules) { // webpackBootstrap var React = __webpack_require__(2); var dom = React.DOM; - var _require = __webpack_require__(966), + var _require = __webpack_require__(1130), showMenu = _require.showMenu, buildMenu = _require.buildMenu; @@ -13342,7 +13342,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 223 */ -/***/ function(module, exports) { +/***/ function(module, exports, __webpack_require__) { "use strict"; @@ -13350,8 +13350,11 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); exports.default = assert; + + var _devtoolsConfig = __webpack_require__(828); + function assert(condition, message) { - if (!condition) { + if ((0, _devtoolsConfig.isDevelopment)() && !condition) { throw new Error(`Assertion failure: ${message}`); } } @@ -13418,7 +13421,7 @@ return /******/ (function(modules) { // webpackBootstrap pref("devtools.debugger.file-search-case-sensitive", false); pref("devtools.debugger.file-search-whole-word", false); pref("devtools.debugger.file-search-regex-match", false); - pref("devtools.debugger.prefs-schema-version", "1.0.0"); + pref("devtools.debugger.prefs-schema-version", "1.0.1"); } const prefs = new PrefsHelper("devtools", { @@ -13475,6 +13478,10 @@ return /******/ (function(modules) { // webpackBootstrap var _breakpoints2 = _interopRequireDefault(_breakpoints); + var _pendingBreakpoints = __webpack_require__(1133); + + var _pendingBreakpoints2 = _interopRequireDefault(_pendingBreakpoints); + var _asyncRequests = __webpack_require__(238); var _asyncRequests2 = _interopRequireDefault(_asyncRequests); @@ -13497,19 +13504,22 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + exports.default = { expressions: _expressions2.default, eventListeners: _eventListeners2.default, sources: _sources2.default, breakpoints: _breakpoints2.default, + pendingBreakpoints: _pendingBreakpoints2.default, asyncRequests: _asyncRequests2.default, pause: _pause2.default, ui: _ui2.default, ast: _ast2.default, coverage: _coverage2.default - }; /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + }; /***/ }, /* 228 */ @@ -13730,7 +13740,7 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSelectedSourceText = exports.getSelectedSource = exports.getSelectedLocation = exports.getSourcesForTabs = exports.getSourceTabs = exports.getSources = undefined; + exports.getSelectedSourceText = exports.getSelectedSource = exports.getSelectedLocation = exports.getSourcesForTabs = exports.getSearchTabs = exports.getSourceTabs = exports.getSources = undefined; exports.initialState = initialState; exports.removeSourceFromTabList = removeSourceFromTabList; exports.removeSourcesFromTabList = removeSourcesFromTabList; @@ -13813,9 +13823,7 @@ return /******/ (function(modules) { // webpackBootstrap return state.set("selectedLocation", { sourceId: action.source.id, line: action.line - }).set("pendingSelectedLocation", location).merge({ - tabs: updateTabList({ sources: state }, action.source.url) - }); + }).set("pendingSelectedLocation", location); case "CLEAR_SELECTED_SOURCE": location = { url: "" }; @@ -13832,6 +13840,11 @@ return /******/ (function(modules) { // webpackBootstrap _prefs.prefs.pendingSelectedLocation = location; return state.set("pendingSelectedLocation", location); + case "ADD_TAB": + return state.merge({ + tabs: updateTabList({ sources: state }, action.source.url) + }); + case "MOVE_TAB": return state.merge({ tabs: updateTabList({ sources: state }, action.url, action.tabIndex) @@ -13873,7 +13886,8 @@ return /******/ (function(modules) { // webpackBootstrap function getTextPropsFromAction(action) { var source = action.source; - var sourceText = action.value; + var value = action.value; + if (action.status === "start") { return { id: source.id, loading: true }; @@ -13881,9 +13895,9 @@ return /******/ (function(modules) { // webpackBootstrap return { id: source.id, error: action.error, loading: false }; } return { - text: sourceText.text, + text: value.text, id: source.id, - contentType: sourceText.contentType, + contentType: value.contentType, loading: false }; } @@ -14041,6 +14055,8 @@ return /******/ (function(modules) { // webpackBootstrap var getSourceTabs = exports.getSourceTabs = (0, _reselect.createSelector)(getTabs, getSources, (tabs, sources) => tabs.filter(tab => getSourceByUrlInSources(sources, tab))); + var getSearchTabs = exports.getSearchTabs = (0, _reselect.createSelector)(getTabs, getSources, (tabs, sources) => tabs.filter(tab => !getSourceByUrlInSources(sources, tab))); + var getSourcesForTabs = exports.getSourcesForTabs = (0, _reselect.createSelector)(getSourceTabs, getSources, (tabs, sources) => { return tabs.map(tab => getSourceByUrlInSources(sources, tab)).filter(source => source); }); @@ -14071,25 +14087,20 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMode = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.isPretty = exports.isJavaScript = undefined; + exports.getMode = exports.getSourcePath = exports.getFilenameFromURL = exports.getFilename = exports.getRawSourceURL = exports.getPrettySourceURL = exports.isPretty = exports.isJavaScript = undefined; var _utils = __webpack_require__(234); var _path = __webpack_require__(235); + var _url = __webpack_require__(334); + /** * Trims the query part or reference identifier of a url string, if necessary. * * @memberof utils/source * @static */ - - - /** - * Utils for working with Source URLs - * @module utils/source - */ - function trimUrlQuery(url) { var length = url.length; var q1 = url.indexOf("?"); @@ -14110,6 +14121,13 @@ return /******/ (function(modules) { // webpackBootstrap * @memberof utils/source * @static */ + + + /** + * Utils for working with Source URLs + * @module utils/source + */ + function isJavaScript(url) { var contentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; @@ -14180,9 +14198,23 @@ return /******/ (function(modules) { // webpackBootstrap "text/x-elm": "elm", "text/x-clojure": "clojure", "text/wasm": { name: "text" }, - html: { name: "htmlmixed" } + "text/html": { name: "htmlmixed" } }; + function getSourcePath(source) { + if (!source.url) { + return ""; + } + + var _parseURL = (0, _url.parse)(source.url), + path = _parseURL.path, + href = _parseURL.href; + // for URLs like "about:home" the path is null so we pass the full href + + + return path || href; + } + /** * * Returns Code Mirror mode for source content type @@ -14193,27 +14225,30 @@ return /******/ (function(modules) { // webpackBootstrap */ function getMode(source) { - if (!source.text) { - return { name: "text" }; - } - - if (!source.contentType) { - // Use HTML mode for files in which the first non whitespace - // character is `<` regardless of extension. - var name = source.text.match(/^\s* 2 && arguments[2] !== undefined ? arguments[2] : {}; - - // A commited breakpoint is no longer loading, and acts like a normal - // breakpoint - var location = overrides.location || breakpoint.location; - var id = (0, _breakpoint.makeLocationId)(location); - var updatedOpts = _extends({}, overrides, { loading: false }); - var updatedBreakpoint = _extends({}, breakpoint, updatedOpts); - - return state.setIn(["breakpoints", id], updatedBreakpoint); - } - - function correctBreakpoint(state, breakpoint, overrides) { - var intermState = deleteBreakpoint(state, breakpoint.location); - var newLocationId = (0, _breakpoint.makeLocationId)(overrides.location); - var newProperties = _extends({ id: newLocationId }, overrides); - - return commitBreakpoint(intermState, breakpoint, newProperties); - } - - // TODO: remove this in favor of the correct/commit breakpoint pattern - function slideBreakpoint(state, action) { - var _action$value3 = action.value, - actualLocation = _action$value3.actualLocation, - id = _action$value3.id; var breakpoint = action.breakpoint; - var currentBp = state.breakpoints.get(id) || (0, _fromJS2.default)(breakpoint); - - var locationId = (0, _breakpoint.makeLocationId)(breakpoint.location); - var movedLocationId = (0, _breakpoint.makeLocationId)(actualLocation); - var updatedState = state.deleteIn(["breakpoints", locationId]); - - return updatedState.setIn(["breakpoints", movedLocationId], _extends({}, currentBp, { - location: actualLocation - })); - } - - function makePendingBreakpoint(bp) { - var _bp$location = bp.location, - sourceUrl = _bp$location.sourceUrl, - line = _bp$location.line, - column = _bp$location.column, - condition = bp.condition, - disabled = bp.disabled, - generatedLocation = bp.generatedLocation; - - - var location = { sourceUrl, line, column }; - return { condition, disabled, generatedLocation, location }; - } - - function setPendingBreakpoints(state) { - _prefs.prefs.pendingBreakpoints = state.pendingBreakpoints; - } - - function updatePendingBreakpoint(state, breakpoint) { - var id = (0, _breakpoint.makePendingLocationId)(breakpoint.location); - return state.setIn(["pendingBreakpoints", id], makePendingBreakpoint(breakpoint)); - } - - function restorePendingBreakpoints() { - return I.Map(_prefs.prefs.pendingBreakpoints); + var id = (0, _breakpoint2.makeLocationId)(breakpoint.location); + return state.deleteIn(["breakpoints", id]); } // Selectors - - function getBreakpoint(state, location) { - return state.breakpoints.breakpoints.get((0, _breakpoint.makeLocationId)(location)); - } + // TODO: these functions should be moved out of the reducer function getBreakpoints(state) { return state.breakpoints.breakpoints; } - function getBreakpointsForSource(state, sourceId) { - return state.breakpoints.breakpoints.filter(bp => { - return bp.location.sourceId === sourceId; - }); + function getBreakpoint(state, location) { + var breakpoints = getBreakpoints(state); + return breakpoints.get((0, _breakpoint2.makeLocationId)(location)); } function getBreakpointsDisabled(state) { - return state.breakpoints.get("breakpointsDisabled"); + return state.breakpoints.breakpoints.every(x => x.disabled); } function getBreakpointsLoading(state) { @@ -14735,8 +14557,18 @@ return /******/ (function(modules) { // webpackBootstrap return breakpoints.size > 0 && isLoading; } - function getPendingBreakpoints(state) { - return state.breakpoints.pendingBreakpoints; + function getBreakpointsForSource(state, sourceId) { + if (!sourceId) { + return I.Map(); + } + + var isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); + var breakpoints = getBreakpoints(state); + + return breakpoints.filter(bp => { + var location = isGeneratedSource ? bp.generatedLocation || bp.location : bp.location; + return location.sourceId === sourceId; + }); } exports.default = update; @@ -15125,10 +14957,10 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.getSymbolSearchState = exports.getFileSearchState = exports.getProjectSearchState = exports.State = undefined; + exports.State = undefined; + exports.getActiveSearchState = getActiveSearchState; exports.getFileSearchQueryState = getFileSearchQueryState; exports.getFileSearchModifierState = getFileSearchModifierState; - exports.getSymbolSearchResults = getSymbolSearchResults; exports.getSearchResults = getSearchResults; exports.getFrameworkGroupingState = getFrameworkGroupingState; exports.getSymbolSearchType = getSymbolSearchType; @@ -15150,18 +14982,17 @@ return /******/ (function(modules) { // webpackBootstrap */ var State = exports.State = (0, _makeRecord2.default)({ - fileSearchOn: false, + activeSearch: null, fileSearchQuery: "", fileSearchModifiers: (0, _makeRecord2.default)({ caseSensitive: _prefs.prefs.fileSearchCaseSensitive, wholeWord: _prefs.prefs.fileSearchWholeWord, regexMatch: _prefs.prefs.fileSearchRegexMatch })(), - projectSearchOn: false, - symbolSearchOn: false, symbolSearchType: "functions", - symbolSearchResults: [], searchResults: { + matches: [], + matchIndex: -1, index: -1, count: 0 }, @@ -15177,9 +15008,9 @@ return /******/ (function(modules) { // webpackBootstrap var action = arguments[1]; switch (action.type) { - case "TOGGLE_PROJECT_SEARCH": + case "TOGGLE_ACTIVE_SEARCH": { - return state.set("projectSearchOn", action.value); + return state.set("activeSearch", action.value); } case "TOGGLE_FRAMEWORK_GROUPING": @@ -15188,16 +15019,6 @@ return /******/ (function(modules) { // webpackBootstrap return state.set("frameworkGroupingOn", action.value); } - case "TOGGLE_FILE_SEARCH": - { - return state.set("fileSearchOn", action.value); - } - - case "TOGGLE_SYMBOL_SEARCH": - { - return state.set("symbolSearchOn", action.value); - } - case "UPDATE_FILE_SEARCH_QUERY": { return state.set("fileSearchQuery", action.query); @@ -15208,11 +15029,6 @@ return /******/ (function(modules) { // webpackBootstrap return state.set("searchResults", action.results); } - case "UPDATE_SYMBOL_SEARCH_RESULTS": - { - return state.set("symbolSearchResults", action.results); - } - case "TOGGLE_FILE_SEARCH_MODIFIER": { var actionVal = !state.getIn(["fileSearchModifiers", action.modifier]); @@ -15279,9 +15095,8 @@ return /******/ (function(modules) { // webpackBootstrap // NOTE: we'd like to have the app state fully typed // https://github.com/devtools-html/debugger.html/blob/master/src/reducers/sources.js#L179-L185 - - function getSearchState(field, state) { - return state.ui.get(field); + function getActiveSearchState(state) { + return state.ui.get("activeSearch"); } function getFileSearchQueryState(state) { @@ -15292,10 +15107,6 @@ return /******/ (function(modules) { // webpackBootstrap return state.ui.get("fileSearchModifiers"); } - function getSymbolSearchResults(state) { - return state.ui.get("symbolSearchResults"); - } - function getSearchResults(state) { return state.ui.get("searchResults"); } @@ -15308,10 +15119,6 @@ return /******/ (function(modules) { // webpackBootstrap return state.ui.get("symbolSearchType"); } - var getProjectSearchState = exports.getProjectSearchState = getSearchState.bind(null, "projectSearchOn"); - var getFileSearchState = exports.getFileSearchState = getSearchState.bind(null, "fileSearchOn"); - var getSymbolSearchState = exports.getSymbolSearchState = getSearchState.bind(null, "symbolSearchOn"); - function getShownSource(state) { return state.ui.get("shownSource"); } @@ -15419,6 +15226,10 @@ return /******/ (function(modules) { // webpackBootstrap var breakpoints = _interopRequireWildcard(_breakpoints); + var _pendingBreakpoints = __webpack_require__(1133); + + var pendingBreakpoints = _interopRequireWildcard(_pendingBreakpoints); + var _eventListeners = __webpack_require__(231); var eventListeners = _interopRequireWildcard(_eventListeners); @@ -15435,75 +15246,27 @@ return /******/ (function(modules) { // webpackBootstrap var coverage = _interopRequireWildcard(_coverage); + var _breakpointAtLocation = __webpack_require__(1134); + + var _breakpointAtLocation2 = _interopRequireDefault(_breakpointAtLocation); + + var _linesInScope = __webpack_require__(1124); + + var _linesInScope2 = _interopRequireDefault(_linesInScope); + + var _visibleBreakpoints = __webpack_require__(1135); + + var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } /** * @param object - location */ - module.exports = { - getSource: sources.getSource, - getNewSelectedSourceId: sources.getNewSelectedSourceId, - removeSourceFromTabList: sources.removeSourceFromTabList, - removeSourcesFromTabList: sources.removeSourcesFromTabList, - getSourceByURL: sources.getSourceByURL, - getSourceInSources: sources.getSourceInSources, - getSources: sources.getSources, - getSourceTabs: sources.getSourceTabs, - getSourcesForTabs: sources.getSourcesForTabs, - getSelectedSource: sources.getSelectedSource, - getSelectedSourceText: sources.getSelectedSourceText, - getSelectedLocation: sources.getSelectedLocation, - getPendingSelectedLocation: sources.getPendingSelectedLocation, - getPrettySource: sources.getPrettySource, - - getBreakpoint: breakpoints.getBreakpoint, - getBreakpoints: breakpoints.getBreakpoints, - getPendingBreakpoints: breakpoints.getPendingBreakpoints, - getBreakpointsForSource: breakpoints.getBreakpointsForSource, - getBreakpointsDisabled: breakpoints.getBreakpointsDisabled, - getBreakpointsLoading: breakpoints.getBreakpointsLoading, - - getPause: pause.getPause, - getChromeScopes: pause.getChromeScopes, - getLoadedObjects: pause.getLoadedObjects, - getLoadedObject: pause.getLoadedObject, - getFrameScopes: pause.getFrameScopes, - getObjectProperties: pause.getObjectProperties, - getIsWaitingOnBreak: pause.getIsWaitingOnBreak, - getShouldPauseOnExceptions: pause.getShouldPauseOnExceptions, - getShouldIgnoreCaughtExceptions: pause.getShouldIgnoreCaughtExceptions, - getFrames: pause.getFrames, - getSelectedFrame: pause.getSelectedFrame, - getDebuggeeUrl: pause.getDebuggeeUrl, - - getHitCountForSource: coverage.getHitCountForSource, - getCoverageEnabled: coverage.getCoverageEnabled, - - getEventListeners: eventListeners.getEventListeners, - - getProjectSearchState: ui.getProjectSearchState, - getFileSearchState: ui.getFileSearchState, - getFileSearchQueryState: ui.getFileSearchQueryState, - getFileSearchModifierState: ui.getFileSearchModifierState, - getSymbolSearchResults: ui.getSymbolSearchResults, - getSearchResults: ui.getSearchResults, - getFrameworkGroupingState: ui.getFrameworkGroupingState, - getSymbolSearchState: ui.getSymbolSearchState, - getSymbolSearchType: ui.getSymbolSearchType, - getShownSource: ui.getShownSource, - getPaneCollapse: ui.getPaneCollapse, - - getExpressions: expressions.getExpressions, - getVisibleExpressions: expressions.getVisibleExpressions, - getExpression: expressions.getExpression, - getHighlightedLineRange: ui.getHighlightedLineRange, - - getSymbols: ast.getSymbols, - hasSymbols: ast.hasSymbols, - getOutOfScopeLocations: ast.getOutOfScopeLocations, - getSelection: ast.getSelection - }; + module.exports = Object.assign({}, expressions, sources, pause, breakpoints, pendingBreakpoints, eventListeners, ui, ast, coverage, { getBreakpointAtLocation: _breakpointAtLocation2.default, getInScopeLines: _linesInScope2.default, getVisibleBreakpoints: _visibleBreakpoints2.default }); /***/ }, /* 243 */ @@ -15543,13 +15306,13 @@ return /******/ (function(modules) { // webpackBootstrap var _devtoolsSplitter2 = _interopRequireDefault(_devtoolsSplitter); - var _ProjectSearch2 = __webpack_require__(1060); + var _ProjectSearch2 = __webpack_require__(1139); var _ProjectSearch3 = _interopRequireDefault(_ProjectSearch2); - var _Sources2 = __webpack_require__(388); + var _PrimaryPanes2 = __webpack_require__(1142); - var _Sources3 = _interopRequireDefault(_Sources2); + var _PrimaryPanes3 = _interopRequireDefault(_PrimaryPanes2); var _Editor2 = __webpack_require__(426); @@ -15567,6 +15330,10 @@ return /******/ (function(modules) { // webpackBootstrap var _Tabs2 = _interopRequireDefault(_Tabs); + var _SymbolModal2 = __webpack_require__(1170); + + var _SymbolModal3 = _interopRequireDefault(_SymbolModal2); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var shortcuts = new _devtoolsModules.KeyShortcuts({ window }); @@ -15577,7 +15344,7 @@ return /******/ (function(modules) { // webpackBootstrap var ProjectSearch = (0, _react.createFactory)(_ProjectSearch3.default); - var Sources = (0, _react.createFactory)(_Sources3.default); + var PrimaryPanes = (0, _react.createFactory)(_PrimaryPanes3.default); var Editor = (0, _react.createFactory)(_Editor3.default); @@ -15587,6 +15354,8 @@ return /******/ (function(modules) { // webpackBootstrap var EditorTabs = (0, _react.createFactory)(_Tabs2.default); + var SymbolModal = (0, _react.createFactory)(_SymbolModal3.default); + class App extends _react.Component { constructor(props) { @@ -15648,14 +15417,14 @@ return /******/ (function(modules) { // webpackBootstrap var overflowX = endPanelCollapsed ? "hidden" : "auto"; - return _react.DOM.div({ className: "debugger" }, SplitBox({ + return SplitBox({ style: { width: "100vw" }, initialSize: "250px", minSize: 10, maxSize: "50%", splitterSize: 1, onResizeEnd: size => this.setState({ startPanelSize: size }), - startPanel: Sources({ horizontal }), + startPanel: PrimaryPanes({ horizontal }), startPanelCollapsed, endPanel: SplitBox({ style: { overflowX }, @@ -15670,7 +15439,7 @@ return /******/ (function(modules) { // webpackBootstrap endPanelCollapsed, vert: horizontal }) - })); + }); } renderVerticalLayout() { @@ -15680,7 +15449,7 @@ return /******/ (function(modules) { // webpackBootstrap var horizontal = this.state.horizontal; - return _react.DOM.div({ className: "debugger" }, SplitBox({ + return SplitBox({ style: { width: "100vw" }, initialSize: "300px", minSize: 30, @@ -15694,16 +15463,21 @@ return /******/ (function(modules) { // webpackBootstrap maxSize: "40%", splitterSize: 1, startPanelCollapsed, - startPanel: Sources({ horizontal }), + startPanel: PrimaryPanes({ horizontal }), endPanel: this.renderEditorPane() }), endPanel: SecondaryPanes({ horizontal }), endPanelCollapsed - })); + }); } render() { - return this.state.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout(); + var _props4 = this.props, + selectSource = _props4.selectSource, + selectedSource = _props4.selectedSource; + + + return _react.DOM.div({ className: "debugger" }, this.state.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout(), SymbolModal({ selectSource, selectedSource })); } } @@ -15780,143 +15554,6 @@ return /******/ (function(modules) { // webpackBootstrap 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"); } }; }(); var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; - - var _getGeneratedLocation = (() => { - var _ref = _asyncToGenerator(function* (source, sourceMaps, location) { - if (!sourceMaps.isOriginalId(location.sourceId)) { - return location; - } - - return yield sourceMaps.getGeneratedLocation(location, source.toJS()); - }); - - return function _getGeneratedLocation(_x2, _x3, _x4) { - return _ref.apply(this, arguments); - }; - })(); - - var _formatClientBreakpoint = (() => { - var _ref2 = _asyncToGenerator(function* (clientBreakpoint, sourceMaps, location) { - var clientOriginalLocation = yield sourceMaps.getOriginalLocation(clientBreakpoint.actualLocation); - - // make sure that we are re-adding the same type of breakpoint. Column - // or line - var actualLocation = (0, _breakpoint.equalizeLocationColumn)(clientOriginalLocation, location); - - // the generatedLocation might have slid, so now we can adjust it - var generatedLocation = clientBreakpoint.actualLocation; - - var id = clientBreakpoint.id, - hitCount = clientBreakpoint.hitCount; - - return { id, actualLocation, hitCount, generatedLocation }; - }); - - return function _formatClientBreakpoint(_x5, _x6, _x7) { - return _ref2.apply(this, arguments); - }; - })(); - - // we have three forms of syncing: disabled syncing, existing server syncing - // and adding a new breakpoint - - - var syncClientBreakpoint = (() => { - var _ref3 = _asyncToGenerator(function* (sourceId, client, sourceMaps, pendingBreakpoint) { - var generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; - - // this is the generatedLocation of the pending breakpoint, with - // the source id updated to reflect the new connection - var oldGeneratedLocation = _extends({}, pendingBreakpoint.generatedLocation, { - sourceId: generatedSourceId - }); - - /** ******* CASE 1: Disabled ***********/ - // early return if breakpoint is disabled, send overrides to update - // the id as expected - if (pendingBreakpoint.disabled) { - return { - id: generatedSourceId, - actualLocation: _extends({}, pendingBreakpoint.location, { id: sourceId }), - generatedLocation: oldGeneratedLocation - }; - } - - /** ******* CASE 2: Merge Server Breakpoint ***********/ - // early return if breakpoint exists on the server, send overrides - // to update the id as expected - var existingClient = client.getBreakpointByLocation(oldGeneratedLocation); - - if (existingClient) { - return _formatClientBreakpoint(existingClient, sourceMaps, pendingBreakpoint.location); - } - - /** ******* CASE 3: Add New Breakpoint ***********/ - // If we are not disabled, set the breakpoint on the server and get - // that info so we can set it on our breakpoints. - var clientBreakpoint = yield client.setBreakpoint(oldGeneratedLocation, pendingBreakpoint.condition, sourceMaps.isOriginalId(sourceId)); - - return _formatClientBreakpoint(clientBreakpoint, sourceMaps, pendingBreakpoint.location); - }); - - return function syncClientBreakpoint(_x8, _x9, _x10, _x11) { - return _ref3.apply(this, arguments); - }; - })(); - - var addClientBreakpoint = (() => { - var _ref4 = _asyncToGenerator(function* (state, client, sourceMaps, breakpoint) { - var location = breakpoint.location; - var source = (0, _selectors.getSource)(state, location.sourceId); - var generatedLocation = yield _getGeneratedLocation(source, sourceMaps, location); - - var clientBreakpoint = yield client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(breakpoint.location.sourceId)); - - var actualLocation = yield sourceMaps.getOriginalLocation(clientBreakpoint.actualLocation); - - var id = clientBreakpoint.id, - hitCount = clientBreakpoint.hitCount; - - return { - id, - actualLocation, - hitCount, - generatedLocation: clientBreakpoint.actualLocation - }; - }); - - return function addClientBreakpoint(_x12, _x13, _x14, _x15) { - return _ref4.apply(this, arguments); - }; - })(); - - /** - * Enabling a breakpoint - * will reuse the existing breakpoint information that is stored. - * - * @memberof actions/breakpoints - * @static - * @param {Location} $1.location Location value - */ - - - exports.enableBreakpoint = enableBreakpoint; - exports.syncBreakpoint = syncBreakpoint; - exports.addBreakpoint = addBreakpoint; - exports.disableBreakpoint = disableBreakpoint; - exports.removeBreakpoint = removeBreakpoint; - exports.toggleAllBreakpoints = toggleAllBreakpoints; - exports.setBreakpointCondition = setBreakpointCondition; - - var _promise = __webpack_require__(193); - - var _selectors = __webpack_require__(242); - - var _devtoolsSourceMap = __webpack_require__(898); - - var _breakpoint = __webpack_require__(1057); - - function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ @@ -15926,46 +15563,34 @@ return /******/ (function(modules) { // webpackBootstrap * @module actions/breakpoints */ - function _breakpointExists(state, location) { - var currentBp = (0, _selectors.getBreakpoint)(state, location); - return currentBp && !currentBp.disabled; - } + // this will need to be changed so that addCLientBreakpoint is removed - function _createBreakpoint(location) { - var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - var condition = overrides.condition, - disabled = overrides.disabled, - generatedLocation = overrides.generatedLocation; - var properties = { - condition: condition || null, - disabled: disabled || false, - generatedLocation, - location - }; + exports.syncBreakpoint = syncBreakpoint; + exports.addBreakpoint = addBreakpoint; + exports.removeBreakpoint = removeBreakpoint; + exports.enableBreakpoint = enableBreakpoint; + exports.disableBreakpoint = disableBreakpoint; + exports.toggleAllBreakpoints = toggleAllBreakpoints; + exports.setBreakpointCondition = setBreakpointCondition; + exports.toggleBreakpoint = toggleBreakpoint; + exports.toggleDisabledBreakpoint = toggleDisabledBreakpoint; - return properties; - } + var _promise = __webpack_require__(193); - function enableBreakpoint(location) { - return (_ref5) => { - var dispatch = _ref5.dispatch, - getState = _ref5.getState, - client = _ref5.client, - sourceMaps = _ref5.sourceMaps; + var _selectors = __webpack_require__(242); - var breakpoint = (0, _selectors.getBreakpoint)(getState(), location); - if (!breakpoint) { - throw new Error("attempted to enable a breakpoint that does not exist"); - } + var _breakpoint = __webpack_require__(1057); - return dispatch({ - type: "ENABLE_BREAKPOINT", - breakpoint, - [_promise.PROMISE]: addClientBreakpoint(getState(), client, sourceMaps, breakpoint) - }); - }; - } + var _addBreakpoint = __webpack_require__(1136); + + var _addBreakpoint2 = _interopRequireDefault(_addBreakpoint); + + var _syncBreakpoint = __webpack_require__(1137); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** * Syncing a breakpoint add breakpoint information that is stored, and @@ -15977,20 +15602,20 @@ return /******/ (function(modules) { // webpackBootstrap * @param {PendingBreakpoint} $1.location PendingBreakpoint value */ function syncBreakpoint(sourceId, pendingBreakpoint) { - return (_ref6) => { - var dispatch = _ref6.dispatch, - getState = _ref6.getState, - client = _ref6.client, - sourceMaps = _ref6.sourceMaps; + return (_ref) => { + var dispatch = _ref.dispatch, + getState = _ref.getState, + client = _ref.client, + sourceMaps = _ref.sourceMaps; var _pendingBreakpoint$lo = pendingBreakpoint.location, line = _pendingBreakpoint$lo.line, sourceUrl = _pendingBreakpoint$lo.sourceUrl, column = _pendingBreakpoint$lo.column; var location = { sourceId, sourceUrl, line, column }; - var breakpoint = _createBreakpoint(location, pendingBreakpoint); + var breakpoint = (0, _breakpoint.createBreakpoint)(location, pendingBreakpoint); - var syncPromise = syncClientBreakpoint(sourceId, client, sourceMaps, pendingBreakpoint); + var syncPromise = (0, _syncBreakpoint.syncClientBreakpoint)(sourceId, client, sourceMaps, pendingBreakpoint); return dispatch({ type: "SYNC_BREAKPOINT", @@ -16008,60 +15633,18 @@ return /******/ (function(modules) { // webpackBootstrap * @param {String} $1.condition Conditional breakpoint condition value * @param {Boolean} $1.disabled Disable value for breakpoint value */ - function addBreakpoint(location) { - var _ref7 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - condition = _ref7.condition; - return (_ref8) => { - var dispatch = _ref8.dispatch, - getState = _ref8.getState, - client = _ref8.client, - sourceMaps = _ref8.sourceMaps; + function addBreakpoint(location, condition) { + var breakpoint = (0, _breakpoint.createBreakpoint)(location, { condition }); + return (_ref2) => { + var dispatch = _ref2.dispatch, + getState = _ref2.getState, + sourceMaps = _ref2.sourceMaps, + client = _ref2.client; - if (_breakpointExists(getState(), location)) { - return Promise.resolve(); - } - - var breakpoint = _createBreakpoint(location, { condition }); - return dispatch({ - type: "ADD_BREAKPOINT", - breakpoint, - condition: condition, - [_promise.PROMISE]: addClientBreakpoint(getState(), client, sourceMaps, breakpoint) - }); - }; - } - - /** - * Disable a single breakpoint - * - * @memberof actions/breakpoints - * @static - */ - function disableBreakpoint(location) { - return (_ref9) => { - var dispatch = _ref9.dispatch, - getState = _ref9.getState, - client = _ref9.client; - - var bp = (0, _selectors.getBreakpoint)(getState(), location); - if (!bp) { - throw new Error("attempt to disable a breakpoint that does not exist"); - } - if (bp.loading) { - // TODO(jwl): make this wait until the breakpoint is saved if it - // is still loading - throw new Error("attempt to disable unsaved breakpoint"); - } - - var action = { - type: "DISABLE_BREAKPOINT", - breakpoint: bp, - disabled: true, - [_promise.PROMISE]: client.removeBreakpoint(bp) - }; - - return dispatch(action); + var action = { type: "ADD_BREAKPOINT", breakpoint }; + var promise = (0, _addBreakpoint2.default)(getState, client, sourceMaps, action); + return dispatch(_extends({}, action, { [_promise.PROMISE]: promise })); }; } @@ -16072,39 +15655,117 @@ return /******/ (function(modules) { // webpackBootstrap * @static */ function removeBreakpoint(location) { - return (_ref10) => { - var dispatch = _ref10.dispatch, - getState = _ref10.getState, - client = _ref10.client; + return (_ref3) => { + var dispatch = _ref3.dispatch, + getState = _ref3.getState, + client = _ref3.client; var bp = (0, _selectors.getBreakpoint)(getState(), location); if (!bp) { throw new Error("attempt to remove breakpoint that does not exist"); } + if (bp.loading) { // TODO(jwl): make this wait until the breakpoint is saved if it // is still loading throw new Error("attempt to remove unsaved breakpoint"); } - var action = { - type: "REMOVE_BREAKPOINT", - breakpoint: bp - }; - // If the breakpoint is already disabled, we don't need to communicate // with the server. We just need to dispatch an action // simulating a successful server request if (bp.disabled) { - return dispatch(Object.assign({}, action, { status: "done" })); + return dispatch({ + type: "REMOVE_BREAKPOINT", + breakpoint: bp, + status: "done" + }); } - return dispatch(Object.assign({}, action, { + return dispatch({ + type: "REMOVE_BREAKPOINT", + breakpoint: bp, [_promise.PROMISE]: client.removeBreakpoint(bp) - })); + }); }; } + /** + * Enabling a breakpoint + * will reuse the existing breakpoint information that is stored. + * + * @memberof actions/breakpoints + * @static + * @param {Location} $1.location Location value + */ + function enableBreakpoint(location) { + return (() => { + var _ref4 = _asyncToGenerator(function* (_ref5) { + var dispatch = _ref5.dispatch, + getState = _ref5.getState, + client = _ref5.client, + sourceMaps = _ref5.sourceMaps; + + var breakpoint = (0, _selectors.getBreakpoint)(getState(), location); + if (!breakpoint) { + throw new Error("attempted to enable a breakpoint that does not exist"); + } + + var action = { type: "ENABLE_BREAKPOINT", breakpoint }; + var promise = (0, _addBreakpoint2.default)(getState, client, sourceMaps, action); + return dispatch({ + type: "ENABLE_BREAKPOINT", + breakpoint, + [_promise.PROMISE]: promise + }); + }); + + return function (_x) { + return _ref4.apply(this, arguments); + }; + })(); + } + + /** + * Disable a single breakpoint + * + * @memberof actions/breakpoints + * @static + */ + function disableBreakpoint(location) { + return (() => { + var _ref6 = _asyncToGenerator(function* (_ref7) { + var dispatch = _ref7.dispatch, + getState = _ref7.getState, + client = _ref7.client; + + var bp = (0, _selectors.getBreakpoint)(getState(), location); + + if (!bp) { + throw new Error("attempt to disable a breakpoint that does not exist"); + } + + if (bp.loading) { + // TODO(jwl): make this wait until the breakpoint is saved if it + // is still loading + throw new Error("attempt to disable unsaved breakpoint"); + } + + yield client.removeBreakpoint(bp); + var newBreakpoint = _extends({}, bp, { disabled: true }); + + return dispatch({ + type: "DISABLE_BREAKPOINT", + breakpoint: newBreakpoint + }); + }); + + return function (_x2) { + return _ref6.apply(this, arguments); + }; + })(); + } + /** * Toggle All Breakpoints * @@ -16112,29 +15773,29 @@ return /******/ (function(modules) { // webpackBootstrap * @static */ function toggleAllBreakpoints(shouldDisableBreakpoints) { - return (_ref11) => { - var dispatch = _ref11.dispatch, - getState = _ref11.getState; + return (() => { + var _ref8 = _asyncToGenerator(function* (_ref9) { + var dispatch = _ref9.dispatch, + getState = _ref9.getState; - var breakpoints = (0, _selectors.getBreakpoints)(getState()); - return dispatch({ - type: "TOGGLE_BREAKPOINTS", - shouldDisableBreakpoints, - [_promise.PROMISE]: _asyncToGenerator(function* () { - for (var _ref13 of breakpoints) { - var _ref14 = _slicedToArray(_ref13, 2); + var breakpoints = (0, _selectors.getBreakpoints)(getState()); + for (var _ref10 of breakpoints) { + var _ref11 = _slicedToArray(_ref10, 2); - var breakpoint = _ref14[1]; + var breakpoint = _ref11[1]; - if (shouldDisableBreakpoints) { - yield dispatch(disableBreakpoint(breakpoint.location)); - } else { - yield dispatch(enableBreakpoint(breakpoint.location)); - } + if (shouldDisableBreakpoints) { + yield dispatch(disableBreakpoint(breakpoint.location)); + } else { + yield dispatch(enableBreakpoint(breakpoint.location)); } - })() + } }); - }; + + return function (_x3) { + return _ref8.apply(this, arguments); + }; + })(); } /** @@ -16150,32 +15811,98 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Boolean} $1.disabled Disable value for breakpoint value */ function setBreakpointCondition(location) { - var _ref15 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - condition = _ref15.condition; + var _ref12 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, + condition = _ref12.condition; + return (() => { + var _ref13 = _asyncToGenerator(function* (_ref14) { + var dispatch = _ref14.dispatch, + getState = _ref14.getState, + client = _ref14.client, + sourceMaps = _ref14.sourceMaps; + + var bp = (0, _selectors.getBreakpoint)(getState(), location); + if (!bp) { + return dispatch(addBreakpoint(location, condition)); + } + + if (bp.loading) { + // TODO(jwl): when this function is called, make sure the action + // creator waits for the breakpoint to exist + throw new Error("breakpoint must be saved"); + } + + yield client.setBreakpointCondition(bp.id, location, condition, sourceMaps.isOriginalId(bp.location.sourceId)); + + var newBreakpoint = _extends({}, bp, { condition }); + + (0, _breakpoint.assertBreakpoint)(newBreakpoint); + + return dispatch({ + type: "SET_BREAKPOINT_CONDITION", + breakpoint: newBreakpoint + }); + }); + + return function (_x5) { + return _ref13.apply(this, arguments); + }; + })(); + } + + function toggleBreakpoint(line, column) { + return (_ref15) => { + var dispatch = _ref15.dispatch, + getState = _ref15.getState, + client = _ref15.client, + sourceMaps = _ref15.sourceMaps; + + var selectedSource = (0, _selectors.getSelectedSource)(getState()); + var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); + + if (bp && bp.loading) { + return; + } + + if (bp) { + // NOTE: it's possible the breakpoint has slid to a column + return dispatch(removeBreakpoint({ + sourceId: bp.location.sourceId, + sourceUrl: bp.location.sourceUrl, + line: bp.location.line, + column: column || bp.location.column + })); + } + + return dispatch(addBreakpoint({ + sourceId: selectedSource.get("id"), + sourceUrl: selectedSource.get("url"), + line: line, + column: column + })); + }; + } + + function toggleDisabledBreakpoint(line, column) { return (_ref16) => { var dispatch = _ref16.dispatch, getState = _ref16.getState, client = _ref16.client, sourceMaps = _ref16.sourceMaps; - var bp = (0, _selectors.getBreakpoint)(getState(), location); + var bp = (0, _selectors.getBreakpointAtLocation)(getState(), { line, column }); + if (bp && bp.loading) { + return; + } + if (!bp) { - return dispatch(addBreakpoint(location, { condition })); + throw new Error("attempt to disable breakpoint that does not exist"); } - if (bp.loading) { - // TODO(jwl): when this function is called, make sure the action - // creator waits for the breakpoint to exist - throw new Error("breakpoint must be saved"); + if (!bp.disabled) { + return dispatch(disableBreakpoint(bp.location)); } - - return dispatch({ - type: "SET_BREAKPOINT_CONDITION", - breakpoint: bp, - condition: condition, - [_promise.PROMISE]: client.setBreakpointCondition(bp.id, location, condition, sourceMaps.isOriginalId(bp.location.sourceId)) - }); + return dispatch(enableBreakpoint(bp.location)); }; } @@ -16939,12 +16666,14 @@ return /******/ (function(modules) { // webpackBootstrap exports.selectSourceURL = selectSourceURL; exports.selectSource = selectSource; exports.jumpToMappedLocation = jumpToMappedLocation; + exports.addTab = addTab; exports.moveTab = moveTab; exports.closeTab = closeTab; exports.closeTabs = closeTabs; exports.togglePrettyPrint = togglePrettyPrint; exports.toggleBlackBox = toggleBlackBox; exports.loadSourceText = loadSourceText; + exports.loadAllSources = loadAllSources; exports.getTextForSources = getTextForSources; var _defer = __webpack_require__(194); @@ -17133,7 +16862,9 @@ return /******/ (function(modules) { // webpackBootstrap return dispatch({ type: "CLEAR_SELECTED_SOURCE" }); } - dispatch({ type: "TOGGLE_PROJECT_SEARCH", value: false }); + dispatch({ type: "TOGGLE_ACTIVE_SEARCH", value: null }); + + dispatch(addTab(source.toJS(), 0)); return dispatch({ type: "SELECT_SOURCE", @@ -17181,6 +16912,14 @@ return /******/ (function(modules) { // webpackBootstrap })(); } + function addTab(source, tabIndex) { + return { + type: "ADD_TAB", + source, + tabIndex + }; + } + function moveTab(url, tabIndex) { return { type: "MOVE_TAB", @@ -17342,13 +17081,11 @@ return /******/ (function(modules) { // webpackBootstrap var response = yield client.sourceContents(source.id); - var sourceText = { + return { id: source.id, text: response.source, contentType: response.contentType || "text/javascript" }; - - return sourceText; })() }); @@ -17362,6 +17099,33 @@ return /******/ (function(modules) { // webpackBootstrap })(); } + /** + Load the text for all the avaliable sources + * @memberof actions/sources + * @static + */ + function loadAllSources() { + return (() => { + var _ref24 = _asyncToGenerator(function* (_ref25) { + var dispatch = _ref25.dispatch, + getState = _ref25.getState; + + var sources = (0, _selectors.getSources)(getState()); + for (var _ref26 of sources) { + var _ref27 = _slicedToArray(_ref26, 2); + + var source = _ref27[1]; + + yield dispatch(loadSourceText(source.toJS())); + } + }); + + return function (_x16) { + return _ref24.apply(this, arguments); + }; + })(); + } + // delay is in ms var FETCH_SOURCE_RESPONSE_DELAY = 200; @@ -17377,9 +17141,9 @@ return /******/ (function(modules) { // webpackBootstrap * A promise that is resolved after source texts have been fetched. */ function getTextForSources(actors) { - return (_ref24) => { - var dispatch = _ref24.dispatch, - getState = _ref24.getState; + return (_ref28) => { + var dispatch = _ref28.dispatch, + getState = _ref28.getState; var deferred = (0, _defer2.default)(); var pending = new Set(actors); @@ -17394,9 +17158,9 @@ return /******/ (function(modules) { // webpackBootstrap var _loop = function (actor) { var source = (0, _selectors.getSource)(getState(), actor); - dispatch(loadSourceText(source)).then((_ref31) => { - var text = _ref31.text, - contentType = _ref31.contentType; + dispatch(loadSourceText(source)).then((_ref35) => { + var text = _ref35.text, + contentType = _ref35.contentType; onFetch([source, text, contentType]); }, err => { @@ -17417,11 +17181,11 @@ return /******/ (function(modules) { // webpackBootstrap } /* Called if fetching a source finishes successfully. */ - function onFetch(_ref25) { - var _ref26 = _slicedToArray(_ref25, 3), - aSource = _ref26[0], - aText = _ref26[1], - aContentType = _ref26[2]; + function onFetch(_ref29) { + var _ref30 = _slicedToArray(_ref29, 3), + aSource = _ref30[0], + aText = _ref30[1], + aContentType = _ref30[2]; // If fetching the source has previously timed out, discard it this time. if (!pending.has(aSource.actor)) { @@ -17445,12 +17209,12 @@ return /******/ (function(modules) { // webpackBootstrap if (pending.size == 0) { // Sort the fetched sources alphabetically by their url. if (deferred) { - deferred.resolve(fetched.sort((_ref27, _ref28) => { - var _ref30 = _slicedToArray(_ref27, 1), - aFirst = _ref30[0]; + deferred.resolve(fetched.sort((_ref31, _ref32) => { + var _ref34 = _slicedToArray(_ref31, 1), + aFirst = _ref34[0]; - var _ref29 = _slicedToArray(_ref28, 1), - aSecond = _ref29[0]; + var _ref33 = _slicedToArray(_ref32, 1), + aSecond = _ref33[0]; return aFirst > aSecond ? -1 : 1; })); @@ -17588,27 +17352,6 @@ return /******/ (function(modules) { // webpackBootstrap return shouldShowPrettyPrint(selectedSource); } - function breakpointAtLocation(breakpoints, _ref) { - var line = _ref.line, - _ref$column = _ref.column, - column = _ref$column === undefined ? undefined : _ref$column; - - return breakpoints.find(bp => { - var sameLine = bp.location.line === line + 1; - if (!sameLine) { - return false; - } - - // NOTE: when column breakpoints are disabled we want to find - // the first breakpoint - if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) { - return true; - } - - return bp.location.column === column; - }); - } - function traverseResults(e, ctx, query, dir, modifiers) { e.stopPropagation(); e.preventDefault(); @@ -17666,14 +17409,18 @@ return /******/ (function(modules) { // webpackBootstrap return editor.codeMirror.markText({ ch: start.column, line: start.line - 1 }, { ch: end.column, line: end.line - 1 }, { className }); } + function lineAtHeight(editor, event) { + return editor.codeMirror.lineAtHeight(event.clientY) + 1; + } + module.exports = Object.assign({}, expressionUtils, sourceDocumentUtils, sourceSearchUtils, _devtoolsSourceEditor.SourceEditorUtils, { createEditor, shouldShowPrettyPrint, shouldShowFooter, - breakpointAtLocation, traverseResults, updateDocument, - markText + markText, + lineAtHeight }); /***/ }, @@ -17717,13 +17464,17 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 260 */ -/***/ function(module, exports) { +/***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); + exports.showSourceText = exports.clearDocuments = exports.removeDocument = exports.setDocument = exports.getDocument = undefined; + + var _source = __webpack_require__(233); + var sourceDocs = {}; function getDocument(key) { @@ -17742,10 +17493,38 @@ return /******/ (function(modules) { // webpackBootstrap sourceDocs = {}; } + /** + * Handle getting the source document or creating a new + * document with the correct mode and text. + */ + function showSourceText(editor, source) { + if (!source) { + return; + } + + var doc = getDocument(source.id); + if (editor.codeMirror.doc === doc) { + return; + } + + if (doc) { + editor.replaceDocument(doc); + return doc; + } + + doc = editor.createDocument(); + setDocument(source.id, doc); + editor.replaceDocument(doc); + + editor.setText(source.text); + editor.setMode((0, _source.getMode)(source)); + } + exports.getDocument = getDocument; exports.setDocument = setDocument; exports.removeDocument = removeDocument; exports.clearDocuments = clearDocuments; + exports.showSourceText = showSourceText; /***/ }, /* 261 */ @@ -17756,9 +17535,9 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.getMatchIndex = exports.removeOverlay = exports.findPrev = exports.findNext = exports.find = exports.clearIndex = exports.buildQuery = undefined; + exports.getMatchIndex = exports.removeOverlay = exports.findPrev = exports.findNext = exports.find = exports.buildQuery = undefined; - var _buildQuery = __webpack_require__(1116); + var _buildQuery = __webpack_require__(1138); var _buildQuery2 = _interopRequireDefault(_buildQuery); @@ -17783,7 +17562,6 @@ return /******/ (function(modules) { // webpackBootstrap this.posFrom = this.posTo = this.query = null; this.overlay = null; this.results = []; - this.matchIndex = -1; } /** @@ -17902,27 +17680,26 @@ return /******/ (function(modules) { // webpackBootstrap function doSearch(ctx, rev, query, keepSelection, modifiers) { var cm = ctx.cm; - var matchIndex = -1; + if (!cm) { + return; + } + var defaultIndex = { line: -1, ch: -1 }; - cm.operation(function () { + return cm.operation(function () { if (!query || isWhitespace(query)) { return; } var state = getSearchState(cm, query, modifiers); - var newQuery = state.query != query; + var isNewQuery = state.query !== query; state.query = query; updateOverlay(cm, state, query, modifiers); updateCursor(cm, state, keepSelection); - searchNext(ctx, rev, query, newQuery, modifiers); + var searchLocation = searchNext(ctx, rev, query, isNewQuery, modifiers); - // NOTE: We would like to find the correct match index based on where the - // match is in the document. - state.matchIndex = matchIndex; + return searchLocation ? searchLocation.from : defaultIndex; }); - - return matchIndex; } function getCursorPos(newQuery, rev, state) { @@ -18003,7 +17780,6 @@ return /******/ (function(modules) { // webpackBootstrap var state = getSearchState(cm, query, modifiers); state.results = []; - state.matchIndex = -1; if (!state.query) { return; @@ -18043,13 +17819,7 @@ return /******/ (function(modules) { // webpackBootstrap return doSearch(ctx, true, query, keepSelection, modifiers); } - function clearIndex(ctx, query, modifiers) { - var state = getSearchState(ctx.cm, query, modifiers); - state.matchIndex = -1; - } - exports.buildQuery = _buildQuery2.default; - exports.clearIndex = clearIndex; exports.find = find; exports.findNext = findNext; exports.findPrev = findPrev; @@ -20007,6 +19777,8 @@ return /******/ (function(modules) { // webpackBootstrap var _sources2 = __webpack_require__(254); + var _parser = __webpack_require__(827); + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } /** @@ -20028,6 +19800,7 @@ return /******/ (function(modules) { // webpackBootstrap yield sourceMaps.clearSourceMaps(); (0, _editor.clearDocuments)(); + (0, _parser.clearSymbols)(); dispatch(navigate(event.url)); }); @@ -20085,14 +19858,12 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.toggleProjectSearch = toggleProjectSearch; - exports.toggleFileSearch = toggleFileSearch; - exports.toggleSymbolSearch = toggleSymbolSearch; + exports.closeActiveSearch = closeActiveSearch; + exports.setActiveSearch = setActiveSearch; exports.toggleFrameworkGrouping = toggleFrameworkGrouping; exports.setSelectedSymbolType = setSelectedSymbolType; exports.setFileSearchQuery = setFileSearchQuery; exports.updateSearchResults = updateSearchResults; - exports.updateSymbolSearchResults = updateSymbolSearchResults; exports.toggleFileSearchModifier = toggleFileSearchModifier; exports.showSource = showSource; exports.togglePaneCollapse = togglePaneCollapse; @@ -20101,65 +19872,33 @@ return /******/ (function(modules) { // webpackBootstrap var _selectors = __webpack_require__(242); - function toggleProjectSearch(toggleValue) { + function closeActiveSearch() { + return { + type: "TOGGLE_ACTIVE_SEARCH", + value: null + }; + } + function setActiveSearch(activeSearch) { return (_ref) => { var dispatch = _ref.dispatch, getState = _ref.getState; - var projectSearchState = (0, _selectors.getProjectSearchState)(getState()); - if (toggleValue === undefined) { - return dispatch({ - type: "TOGGLE_PROJECT_SEARCH", - value: !projectSearchState - }); - } - - if (projectSearchState == toggleValue) { + var activeSearchState = (0, _selectors.getActiveSearchState)(getState()); + if (activeSearchState === activeSearch) { return; } dispatch({ - type: "TOGGLE_PROJECT_SEARCH", - value: toggleValue - }); - }; - } - - function toggleFileSearch(toggleValue) { - return (_ref2) => { - var dispatch = _ref2.dispatch, - getState = _ref2.getState; - - if (toggleValue != null) { - dispatch({ - type: "TOGGLE_FILE_SEARCH", - value: toggleValue - }); - } else { - dispatch({ - type: "TOGGLE_FILE_SEARCH", - value: !(0, _selectors.getFileSearchState)(getState()) - }); - } - }; - } - - function toggleSymbolSearch(toggleValue) { - return (_ref3) => { - var dispatch = _ref3.dispatch, - getState = _ref3.getState; - - dispatch({ - type: "TOGGLE_SYMBOL_SEARCH", - value: toggleValue + type: "TOGGLE_ACTIVE_SEARCH", + value: activeSearch }); }; } function toggleFrameworkGrouping(toggleValue) { - return (_ref4) => { - var dispatch = _ref4.dispatch, - getState = _ref4.getState; + return (_ref2) => { + var dispatch = _ref2.dispatch, + getState = _ref2.getState; dispatch({ type: "TOGGLE_FRAMEWORK_GROUPING", @@ -20169,9 +19908,9 @@ return /******/ (function(modules) { // webpackBootstrap } function setSelectedSymbolType(symbolType) { - return (_ref5) => { - var dispatch = _ref5.dispatch, - getState = _ref5.getState; + return (_ref3) => { + var dispatch = _ref3.dispatch, + getState = _ref3.getState; dispatch({ type: "SET_SYMBOL_SEARCH_TYPE", @@ -20194,21 +19933,14 @@ return /******/ (function(modules) { // webpackBootstrap }; } - function updateSymbolSearchResults(results) { - return { - type: "UPDATE_SYMBOL_SEARCH_RESULTS", - results - }; - } - function toggleFileSearchModifier(modifier) { return { type: "TOGGLE_FILE_SEARCH_MODIFIER", modifier }; } function showSource(sourceId) { - return (_ref6) => { - var dispatch = _ref6.dispatch, - getState = _ref6.getState; + return (_ref4) => { + var dispatch = _ref4.dispatch, + getState = _ref4.getState; var source = (0, _selectors.getSource)(getState(), sourceId); dispatch({ @@ -22551,7 +22283,8 @@ return /******/ (function(modules) { // webpackBootstrap onBlur, placeholder, value: query, - spellCheck: false + spellCheck: false, + ref: "input" }), _react.DOM.div({ className: "summary" }, query != "" ? summaryMsg : ""), this.renderNav(), (0, _Close2.default)({ handleClick: handleClose, buttonClass: size @@ -22675,7 +22408,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.default = ResultList; ResultList.defaultProps = { - size: "" + size: "small" }; /***/ }, @@ -22693,139 +22426,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 387 */, -/* 388 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react = __webpack_require__(2); - - var _reactImmutableProptypes = __webpack_require__(150); - - var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); - - var _redux = __webpack_require__(3); - - var _reactRedux = __webpack_require__(151); - - var _text = __webpack_require__(389); - - var _actions = __webpack_require__(244); - - var _actions2 = _interopRequireDefault(_actions); - - var _selectors = __webpack_require__(242); - - var _devtoolsConfig = __webpack_require__(828); - - __webpack_require__(424); - - var _classnames = __webpack_require__(175); - - var _classnames2 = _interopRequireDefault(_classnames); - - var _Outline2 = __webpack_require__(921); - - var _Outline3 = _interopRequireDefault(_Outline2); - - var _SourcesTree2 = __webpack_require__(390); - - var _SourcesTree3 = _interopRequireDefault(_SourcesTree2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var Outline = (0, _react.createFactory)(_Outline3.default); - - var SourcesTree = (0, _react.createFactory)(_SourcesTree3.default); - - class Sources extends _react.Component { - - constructor(props) { - super(props); - this.state = { selectedPane: "sources" }; - - this.renderShortcut = this.renderShortcut.bind(this); - this.showPane = this.showPane.bind(this); - this.renderFooter = this.renderFooter.bind(this); - } - - showPane(selectedPane) { - this.setState({ selectedPane }); - } - - renderOutlineTabs() { - if (!(0, _devtoolsConfig.isEnabled)("outline")) { - return; - } - - return [_react.DOM.div({ - className: (0, _classnames2.default)("tab", { - active: this.state.selectedPane === "sources" - }), - onClick: () => this.showPane("sources"), - key: "sources-tab" - }, "Sources View"), _react.DOM.div({ - className: (0, _classnames2.default)("tab", { - active: this.state.selectedPane === "outline" - }), - onClick: () => this.showPane("outline"), - key: "outline-tab" - }, "Outline View")]; - } - - renderFooter() { - return _react.DOM.div({ - className: "source-footer" - }, this.renderOutlineTabs()); - } - - renderShortcut() { - if (this.props.horizontal) { - return _react.DOM.span({ - className: "sources-header-info", - dir: "ltr", - onClick: () => this.props.toggleProjectSearch() - }, L10N.getFormatStr("sources.search", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2")))); - } - } - - renderHeader() { - return _react.DOM.div({ className: "sources-header" }, this.renderShortcut()); - } - - render() { - var selectedPane = this.state.selectedPane; - var _props = this.props, - sources = _props.sources, - selectSource = _props.selectSource; - - - return _react.DOM.div({ className: "sources-panel" }, this.renderHeader(), SourcesTree({ - sources, - selectSource, - isHidden: selectedPane === "outline" - }), Outline({ selectSource, isHidden: selectedPane === "sources" }), this.renderFooter()); - } - } - - Sources.propTypes = { - sources: _reactImmutableProptypes2.default.map.isRequired, - selectSource: _react.PropTypes.func.isRequired, - horizontal: _react.PropTypes.bool.isRequired, - toggleProjectSearch: _react.PropTypes.func.isRequired - }; - - Sources.displayName = "Sources"; - - exports.default = (0, _reactRedux.connect)(state => ({ - sources: (0, _selectors.getSources)(state) - }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Sources); - -/***/ }, +/* 388 */, /* 389 */ /***/ function(module, exports, __webpack_require__) { @@ -22870,300 +22471,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.formatKeyShortcut = formatKeyShortcut; /***/ }, -/* 390 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _redux = __webpack_require__(3); - - var _reactRedux = __webpack_require__(151); - - var _react = __webpack_require__(2); - - var _classnames = __webpack_require__(175); - - var _classnames2 = _interopRequireDefault(_classnames); - - var _reactImmutableProptypes = __webpack_require__(150); - - var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); - - var _immutable = __webpack_require__(146); - - var _selectors = __webpack_require__(242); - - var _sourcesTree = __webpack_require__(391); - - var _ManagedTree2 = __webpack_require__(419); - - var _ManagedTree3 = _interopRequireDefault(_ManagedTree2); - - var _actions = __webpack_require__(244); - - var _actions2 = _interopRequireDefault(_actions); - - var _Svg = __webpack_require__(344); - - var _Svg2 = _interopRequireDefault(_Svg); - - var _devtoolsLaunchpad = __webpack_require__(131); - - var _clipboard = __webpack_require__(423); - - var _utils = __webpack_require__(234); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var ManagedTree = (0, _react.createFactory)(_ManagedTree3.default); - - class SourcesTree extends _react.Component { - - constructor(props) { - super(props); - this.state = (0, _sourcesTree.createTree)(this.props.sources, this.props.debuggeeUrl); - - this.focusItem = this.focusItem.bind(this); - this.selectItem = this.selectItem.bind(this); - this.getIcon = this.getIcon.bind(this); - this.onContextMenu = this.onContextMenu.bind(this); - this.renderItem = this.renderItem.bind(this); - - this.queueUpdate = (0, _utils.throttle)(function () { - if (!this.mounted) { - return; - } - - this.forceUpdate(); - }, 50); - } - - componentDidMount() { - this.mounted = true; - } - - componentWillUnMount() { - this.mounted = false; - } - - shouldComponentUpdate() { - this.queueUpdate(); - return false; - } - - componentWillReceiveProps(nextProps) { - if (this.props.debuggeeUrl != nextProps.debuggeeUrl) { - // Recreate tree because the sort order changed - this.setState((0, _sourcesTree.createTree)(this.props.sources, nextProps.debuggeeUrl)); - return; - } - var selectedSource = this.props.selectedSource; - - if (nextProps.shownSource && nextProps.shownSource != this.props.shownSource) { - var _listItems = (0, _sourcesTree.getDirectories)(nextProps.shownSource, this.state.sourceTree); - - if (_listItems && _listItems[0]) { - this.selectItem(_listItems[0]); - } - - return this.setState({ listItems: _listItems }); - } - - if (nextProps.selectedSource && nextProps.selectedSource != selectedSource) { - var _highlightItems = (0, _sourcesTree.getDirectories)(nextProps.selectedSource.get("url"), this.state.sourceTree); - - return this.setState({ highlightItems: _highlightItems }); - } - - if (nextProps.sources === this.props.sources) { - return; - } - - if (nextProps.sources.size === 0) { - // remove all sources - this.setState((0, _sourcesTree.createTree)(nextProps.sources, this.props.debuggeeUrl)); - return; - } - - // TODO: do not run this every time a source is clicked, - // only when a new source is added - var next = (0, _immutable.Set)(nextProps.sources.valueSeq()); - var prev = (0, _immutable.Set)(this.props.sources.valueSeq()); - var newSet = next.subtract(prev); - - var uncollapsedTree = this.state.uncollapsedTree; - for (var source of newSet) { - (0, _sourcesTree.addToTree)(uncollapsedTree, source, this.props.debuggeeUrl); - } - - // TODO: recreating the tree every time messes with the expanded - // state of ManagedTree, because it depends on item instances - // being the same. The result is that if a source is added at a - // later time, all expanded state is lost. - var sourceTree = newSet.size > 0 ? (0, _sourcesTree.collapseTree)(uncollapsedTree) : this.state.sourceTree; - - this.setState({ - uncollapsedTree, - sourceTree, - parentMap: (0, _sourcesTree.createParentMap)(sourceTree) - }); - } - - focusItem(item) { - this.setState({ focusedItem: item }); - } - - selectItem(item) { - if (!(0, _sourcesTree.nodeHasChildren)(item)) { - this.props.selectSource(item.contents.get("id")); - } - } - - getIcon(item, depth) { - if (depth === 0) { - return (0, _Svg2.default)("domain"); - } - - if (!(0, _sourcesTree.nodeHasChildren)(item)) { - return (0, _Svg2.default)("file"); - } - - return (0, _Svg2.default)("folder"); - } - - onContextMenu(event, item) { - var copySourceUrlLabel = L10N.getStr("copySourceUrl"); - var copySourceUrlKey = L10N.getStr("copySourceUrl.accesskey"); - - event.stopPropagation(); - event.preventDefault(); - - var menuOptions = []; - - if (!(0, _sourcesTree.isDirectory)(item)) { - var source = item.contents.get("url"); - var copySourceUrl = { - id: "node-menu-copy-source", - label: copySourceUrlLabel, - accesskey: copySourceUrlKey, - disabled: false, - click: () => (0, _clipboard.copyToTheClipboard)(source) - }; - - menuOptions.push(copySourceUrl); - } - - (0, _devtoolsLaunchpad.showMenu)(event, menuOptions); - } - - renderItem(item, depth, focused, _, expanded, _ref) { - var setExpanded = _ref.setExpanded; - - var arrow = (0, _Svg2.default)("arrow", { - className: (0, _classnames2.default)({ - expanded: expanded, - hidden: !(0, _sourcesTree.nodeHasChildren)(item) - }), - onClick: e => { - e.stopPropagation(); - setExpanded(item, !expanded); - } - }); - - var icon = this.getIcon(item, depth); - var paddingDir = "paddingRight"; - if (document.body && document.body.parentElement) { - paddingDir = document.body.parentElement.dir == "ltr" ? "paddingLeft" : "paddingRight"; - } - - return _react.DOM.div({ - className: (0, _classnames2.default)("node", { focused }), - style: { [paddingDir]: `${depth * 15}px` }, - key: item.path, - onClick: () => { - this.selectItem(item); - setExpanded(item, !expanded); - }, - onContextMenu: e => this.onContextMenu(e, item) - }, _react.DOM.div(null, arrow, icon, item.name)); - } - - render() { - var isHidden = this.props.isHidden; - var _state = this.state, - focusedItem = _state.focusedItem, - sourceTree = _state.sourceTree, - parentMap = _state.parentMap, - listItems = _state.listItems, - highlightItems = _state.highlightItems; - - - var isEmpty = sourceTree.contents.length === 0; - - var tree = ManagedTree({ - key: isEmpty ? "empty" : "full", - getParent: item => { - return parentMap.get(item); - }, - getChildren: item => { - if ((0, _sourcesTree.nodeHasChildren)(item)) { - return item.contents; - } - return []; - }, - getRoots: () => sourceTree.contents, - getKey: (item, i) => item.path, - itemHeight: 19, - autoExpandDepth: 1, - autoExpandAll: false, - onFocus: this.focusItem, - listItems, - highlightItems, - renderItem: this.renderItem - }); - - var noSourcesMessage = _react.DOM.div({ - className: "no-sources-message" - }, L10N.getStr("sources.noSourcesAvailable")); - - if (isEmpty) { - return noSourcesMessage; - } - return _react.DOM.div({ - className: (0, _classnames2.default)("sources-list", { hidden: isHidden }), - onKeyDown: e => { - if (e.keyCode === 13 && focusedItem) { - this.selectItem(focusedItem); - } - } - }, tree); - } - } - - SourcesTree.propTypes = { - isHidden: _react.PropTypes.bool, - sources: _reactImmutableProptypes2.default.map.isRequired, - selectSource: _react.PropTypes.func.isRequired, - shownSource: _react.PropTypes.string, - selectedSource: _reactImmutableProptypes2.default.map, - debuggeeUrl: _react.PropTypes.string.isRequired - }; - - SourcesTree.displayName = "SourcesTree"; - - exports.default = (0, _reactRedux.connect)(state => { - return { - shownSource: (0, _selectors.getShownSource)(state), - selectedSource: (0, _selectors.getSelectedSource)(state), - debuggeeUrl: (0, _selectors.getDebuggeeUrl)(state) - }; - }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourcesTree); - -/***/ }, +/* 390 */, /* 391 */ /***/ function(module, exports, __webpack_require__) { @@ -24653,8 +23961,7 @@ return /******/ (function(modules) { // webpackBootstrap }])); } }); - - return Tree(props); + return _react.DOM.div({ className: "managed-tree" }, Tree(props)); } } @@ -24699,12 +24006,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.copyToTheClipboard = copyToTheClipboard; /***/ }, -/* 424 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ }, +/* 424 */, /* 425 */, /* 426 */ /***/ function(module, exports, __webpack_require__) { @@ -24729,8 +24031,6 @@ return /******/ (function(modules) { // webpackBootstrap var _reactRedux = __webpack_require__(151); - var _reselect = __webpack_require__(993); - var _classnames = __webpack_require__(175); var _classnames2 = _interopRequireDefault(_classnames); @@ -24741,8 +24041,6 @@ return /******/ (function(modules) { // webpackBootstrap var _debounce2 = _interopRequireDefault(_debounce); - var _source = __webpack_require__(233); - var _GutterMenu = __webpack_require__(655); var _GutterMenu2 = _interopRequireDefault(_GutterMenu); @@ -24757,12 +24055,6 @@ return /******/ (function(modules) { // webpackBootstrap var _selectors = __webpack_require__(242); - var _linesInScope = __webpack_require__(1124); - - var _linesInScope2 = _interopRequireDefault(_linesInScope); - - var _breakpoint = __webpack_require__(1057); - var _actions = __webpack_require__(244); var _actions2 = _interopRequireDefault(_actions); @@ -24783,18 +24075,18 @@ return /******/ (function(modules) { // webpackBootstrap var _Preview3 = _interopRequireDefault(_Preview2); - var _Breakpoint2 = __webpack_require__(714); + var _Breakpoints2 = __webpack_require__(1158); - var _Breakpoint3 = _interopRequireDefault(_Breakpoint2); - - var _ColumnBreakpoint2 = __webpack_require__(1011); - - var _ColumnBreakpoint3 = _interopRequireDefault(_ColumnBreakpoint2); + var _Breakpoints3 = _interopRequireDefault(_Breakpoints2); var _HitMarker2 = __webpack_require__(715); var _HitMarker3 = _interopRequireDefault(_HitMarker2); + var _CallSites2 = __webpack_require__(1159); + + var _CallSites3 = _interopRequireDefault(_CallSites2); + var _editor = __webpack_require__(257); __webpack_require__(716); @@ -24813,12 +24105,12 @@ return /******/ (function(modules) { // webpackBootstrap var Preview = (0, _react.createFactory)(_Preview3.default); - var Breakpoint = (0, _react.createFactory)(_Breakpoint3.default); - - var ColumnBreakpoint = (0, _react.createFactory)(_ColumnBreakpoint3.default); + var Breakpoints = (0, _react.createFactory)(_Breakpoints3.default); var HitMarker = (0, _react.createFactory)(_HitMarker3.default); + var CallSites = (0, _react.createFactory)(_CallSites3.default); + var cssVars = { searchbarHeight: "var(--editor-searchbar-height)", secondSearchbarHeight: "var(--editor-second-searchbar-height)", @@ -24831,12 +24123,12 @@ return /******/ (function(modules) { // webpackBootstrap super(); this.cbPanel = null; - this.editor = null; this.pendingJumpLine = null; this.lastJumpLine = null; this.state = { - highlightedLineRange: null + highlightedLineRange: null, + editor: null }; var self = this; @@ -24847,11 +24139,7 @@ return /******/ (function(modules) { // webpackBootstrap self.onScroll = this.onScroll.bind(this); self.onSearchAgain = this.onSearchAgain.bind(this); self.onToggleBreakpoint = this.onToggleBreakpoint.bind(this); - self.toggleBreakpoint = this.toggleBreakpoint.bind(this); self.onMouseOver = (0, _debounce2.default)(this.onMouseOver, 40); - - // eslint-disable-next-line max-len - self.toggleBreakpointDisabledStatus = this.toggleBreakpointDisabledStatus.bind(this); self.toggleConditionalPanel = this.toggleConditionalPanel.bind(this); } @@ -24864,7 +24152,7 @@ return /******/ (function(modules) { // webpackBootstrap this.clearDebugLine(this.props.selectedFrame); if (nextProps.startPanelSize !== this.props.startPanelSize || nextProps.endPanelSize !== this.props.endPanelSize) { - this.editor.codeMirror.setSize(); + this.state.editor.codeMirror.setSize(); } if (!selectedSource) { @@ -24876,17 +24164,17 @@ return /******/ (function(modules) { // webpackBootstrap } else if (selectedSource.get("error")) { this.showMessage(selectedSource.get("error")); } else if (this.props.selectedSource !== selectedSource) { - this.showSourceText(selectedSource, selectedLocation); + (0, _editor.showSourceText)(this.state.editor, selectedSource.toJS()); } if (this.props.linesInScope !== nextProps.linesInScope) { - this.editor.codeMirror.operation(() => { - (0, _editor.clearLineClass)(this.editor.codeMirror, "in-scope"); + this.state.editor.codeMirror.operation(() => { + (0, _editor.clearLineClass)(this.state.editor.codeMirror, "in-scope"); }); } this.setDebugLine(nextProps.selectedFrame, selectedLocation); - (0, _editor.resizeBreakpointGutter)(this.editor.codeMirror); + (0, _editor.resizeBreakpointGutter)(this.state.editor.codeMirror); } setupEditor() { @@ -24913,7 +24201,6 @@ return /******/ (function(modules) { // webpackBootstrap codeMirrorWrapper.tabIndex = 0; codeMirrorWrapper.addEventListener("keydown", e => this.onKeyDown(e)); codeMirrorWrapper.addEventListener("mouseover", e => this.onMouseOver(e)); - codeMirrorWrapper.addEventListener("click", e => this.onTokenClick(e)); var toggleFoldMarkerVisibility = e => { if (node instanceof HTMLElement) { @@ -24937,12 +24224,13 @@ return /******/ (function(modules) { // webpackBootstrap codeMirror.on("scroll", this.onScroll); + this.setState({ editor }); return editor; } componentDidMount() { this.cbPanel = null; - this.editor = this.setupEditor(); + var editor = this.setupEditor(); var selectedSource = this.props.selectedSource; var shortcuts = this.context.shortcuts; @@ -24957,12 +24245,12 @@ return /******/ (function(modules) { // webpackBootstrap shortcuts.on(searchAgainPrevKey, this.onSearchAgain); shortcuts.on(searchAgainKey, this.onSearchAgain); - (0, _editor.updateDocument)(this.editor, selectedSource); + (0, _editor.updateDocument)(editor, selectedSource); } componentWillUnmount() { - this.editor.destroy(); - this.editor = null; + this.state.editor.destroy(); + this.setState({ editor: null }); var searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); var searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); @@ -25004,19 +24292,19 @@ return /******/ (function(modules) { // webpackBootstrap onToggleBreakpoint(key, e) { e.preventDefault(); - var codeMirror = this.editor.codeMirror; + var codeMirror = this.state.editor.codeMirror; var line = (0, _editor.getCursorLine)(codeMirror); if (e.shiftKey) { - this.toggleConditionalPanel(line); + this.toggleConditionalPanel(line + 1); } else { - this.toggleBreakpoint(line); + this.props.toggleBreakpoint(line + 1); } } onKeyDown(e) { - var codeMirror = this.editor.codeMirror; + var codeMirror = this.state.editor.codeMirror; var key = e.key, target = e.target; @@ -25041,11 +24329,11 @@ return /******/ (function(modules) { // webpackBootstrap * is a multiselection. */ onEscape(key, e) { - if (!this.editor) { + if (!this.state.editor) { return; } - var codeMirror = this.editor.codeMirror; + var codeMirror = this.state.editor.codeMirror; if (codeMirror.listSelections().length > 1) { codeMirror.execCommand("singleSelection"); @@ -25057,27 +24345,13 @@ return /******/ (function(modules) { // webpackBootstrap this.clearPreviewSelection(); } - onTokenClick(e) { - var target = e.target; - - if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints") || !e.altKey || !target.parentElement.closest(".CodeMirror-line")) { - return; - } - - var _getTokenLocation = (0, _editor.getTokenLocation)(this.editor.codeMirror, target), - line = _getTokenLocation.line, - column = _getTokenLocation.column; - - this.toggleBreakpoint(line - 1, column - 1); - } - onSearchAgain(_, e) { var _props2 = this.props, query = _props2.query, searchModifiers = _props2.searchModifiers; - var codeMirror = this.editor.editor.codeMirror; + var codeMirror = this.state.editor.editor.codeMirror; - var ctx = { ed: this.editor, cm: codeMirror }; + var ctx = { ed: this.state.editor, cm: codeMirror }; var direction = e.shiftKey ? "prev" : "next"; (0, _editor.traverseResults)(e, ctx, query, direction, searchModifiers.toJS()); @@ -25111,7 +24385,9 @@ return /******/ (function(modules) { // webpackBootstrap } onGutterClick(cm, line, gutter, ev) { - var selectedSource = this.props.selectedSource; + var _props4 = this.props, + selectedSource = _props4.selectedSource, + toggleBreakpoint = _props4.toggleBreakpoint; // ignore right clicks in the gutter @@ -25124,12 +24400,16 @@ return /******/ (function(modules) { // webpackBootstrap } if (gutter !== "CodeMirror-foldgutter") { - this.toggleBreakpoint(line); + toggleBreakpoint(line + 1); } } onGutterContextMenu(event) { - var selectedSource = this.props.selectedSource; + var _props5 = this.props, + selectedSource = _props5.selectedSource, + breakpoints = _props5.breakpoints, + toggleBreakpoint = _props5.toggleBreakpoint, + toggleDisabledBreakpoint = _props5.toggleDisabledBreakpoint; if (selectedSource && selectedSource.get("isBlackBoxed")) { @@ -25137,15 +24417,17 @@ return /******/ (function(modules) { // webpackBootstrap return; } - var line = this.editor.codeMirror.lineAtHeight(event.clientY); - var bp = (0, _editor.breakpointAtLocation)(this.props.breakpoints, { line }); + var line = (0, _editor.lineAtHeight)(this.state.editor, event); + var breakpoint = breakpoints.find(bp => bp.location.line === line); + (0, _GutterMenu2.default)({ event, line, - bp, - toggleBreakpoint: this.toggleBreakpoint, + breakpoint, + toggleBreakpoint, + toggleDisabledBreakpoint, + showConditionalPanel: this.toggleConditionalPanel, - toggleBreakpointDisabledStatus: this.toggleBreakpointDisabledStatus, isCbPanelOpen: this.isCbPanelOpen(), closeConditionalPanel: this.closeConditionalPanel }); @@ -25155,7 +24437,7 @@ return /******/ (function(modules) { // webpackBootstrap var target = e.target; if (this.inSelectedFrameSource()) { - (0, _editor.updateSelection)(target, this.editor, this.props); + (0, _editor.updateSelection)(target, this.state.editor, this.props); } } @@ -25164,29 +24446,24 @@ return /******/ (function(modules) { // webpackBootstrap return this.closeConditionalPanel(); } - var _props4 = this.props, - selectedLocation = _props4.selectedLocation, - setBreakpointCondition = _props4.setBreakpointCondition, - breakpoints = _props4.breakpoints; + var _props6 = this.props, + selectedLocation = _props6.selectedLocation, + setBreakpointCondition = _props6.setBreakpointCondition, + breakpoints = _props6.breakpoints; var sourceId = selectedLocation ? selectedLocation.sourceId : ""; - var bp = (0, _editor.breakpointAtLocation)(breakpoints, { line }); - var location = { sourceId, line: line + 1 }; - var condition = bp ? bp.condition : ""; - - var setBreakpoint = value => setBreakpointCondition(location, { - condition: value, - getTextForLine: l => (0, _editor.getTextForLine)(this.editor.codeMirror, l) - }); + var breakpoint = breakpoints.find(bp => bp.location.line === line); + var location = { sourceId, line }; + var condition = breakpoint ? breakpoint.condition : ""; var panel = (0, _ConditionalPanel.renderConditionalPanel)({ condition, - setBreakpoint, + setBreakpoint: value => setBreakpointCondition(location, { condition: value }), closePanel: this.closeConditionalPanel }); - this.cbPanel = this.editor.codeMirror.addLineWidget(line, panel, { + this.cbPanel = this.state.editor.codeMirror.addLineWidget(line, panel, { coverGutter: true, noHScroll: false }); @@ -25202,75 +24479,6 @@ return /******/ (function(modules) { // webpackBootstrap return !!this.cbPanel; } - toggleBreakpoint(line) { - var column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; - var _props5 = this.props, - selectedSource = _props5.selectedSource, - selectedLocation = _props5.selectedLocation, - breakpoints = _props5.breakpoints, - addBreakpoint = _props5.addBreakpoint, - removeBreakpoint = _props5.removeBreakpoint; - - var bp = (0, _editor.breakpointAtLocation)(breakpoints, { line, column }); - - if (bp && bp.loading || !selectedLocation || !selectedSource) { - return; - } - - var sourceId = selectedLocation.sourceId; - - - if (bp) { - // NOTE: it's possible the breakpoint has slid to a column - column = column || bp.location.column; - removeBreakpoint({ - sourceId: sourceId, - line: line + 1, - column - }); - } else { - addBreakpoint({ - sourceId: sourceId, - sourceUrl: selectedSource.get("url"), - line: line + 1, - column: column - }, - // Pass in a function to get line text because the breakpoint - // may slide and it needs to compute the value at the new - // line. - { getTextForLine: l => (0, _editor.getTextForLine)(this.editor.codeMirror, l) }); - } - } - - toggleBreakpointDisabledStatus(line) { - var bp = (0, _editor.breakpointAtLocation)(this.props.breakpoints, { line }); - var selectedLocation = this.props.selectedLocation; - - - if (bp && bp.loading || !selectedLocation) { - return; - } - - var sourceId = selectedLocation.sourceId; - - - if (!bp) { - throw new Error("attempt to disable breakpoint that does not exist"); - } - - if (!bp.disabled) { - this.props.disableBreakpoint({ - sourceId: sourceId, - line: line + 1 - }); - } else { - this.props.enableBreakpoint({ - sourceId: sourceId, - line: line + 1 - }); - } - } - clearDebugLine(selectedFrame) { if (selectedFrame) { var line = selectedFrame.location.line; @@ -25278,7 +24486,7 @@ return /******/ (function(modules) { // webpackBootstrap this.debugExpression.clear(); } - this.editor.codeMirror.removeLineClass(line - 1, "line", "new-debug-line"); + this.state.editor.codeMirror.removeLineClass(line - 1, "line", "new-debug-line"); } } @@ -25288,9 +24496,9 @@ return /******/ (function(modules) { // webpackBootstrap line = _selectedFrame$locati.line, column = _selectedFrame$locati.column; - this.editor.codeMirror.addLineClass(line - 1, "line", "new-debug-line"); + this.state.editor.codeMirror.addLineClass(line - 1, "line", "new-debug-line"); - this.debugExpression = (0, _editor.markText)(this.editor, "debug-expression", { + this.debugExpression = (0, _editor.markText)(this.state.editor, "debug-expression", { start: { line, column }, end: { line, column: null } }); @@ -25309,60 +24517,28 @@ return /******/ (function(modules) { // webpackBootstrap // happening ever again (in case CodeMirror re-applies the // class, etc). if (this.lastJumpLine) { - (0, _editor.clearLineClass)(this.editor.codeMirror, "highlight-line"); + (0, _editor.clearLineClass)(this.state.editor.codeMirror, "highlight-line"); } var line = this.pendingJumpLine; - this.editor.alignLine(line); + this.state.editor.alignLine(line); // We only want to do the flashing animation if it's not a debug // line, which has it's own styling. // Also, if it the first time the debugger is being loaded, we don't want // to flash the previously saved selected line. if (this.lastJumpLine && (!this.props.selectedFrame || this.props.selectedFrame.location.line !== line)) { - this.editor.codeMirror.addLineClass(line - 1, "line", "highlight-line"); + this.state.editor.codeMirror.addLineClass(line - 1, "line", "highlight-line"); } this.lastJumpLine = line; this.pendingJumpLine = null; } - setText(text) { - if (!text || !this.editor) { - return; - } - - this.editor.setText(text); - } - showMessage(msg) { - this.editor.replaceDocument(this.editor.createDocument()); - this.setText(msg); - this.editor.setMode({ name: "text" }); - } - - /** - * Handle getting the source document or creating a new - * document with the correct mode and text. - * - */ - showSourceText(source, selectedLocation) { - if (!selectedLocation) { - return; - } - - var doc = (0, _editor.getDocument)(selectedLocation.sourceId); - if (doc) { - this.editor.replaceDocument(doc); - return doc; - } - - doc = this.editor.createDocument(); - (0, _editor.setDocument)(selectedLocation.sourceId, doc); - this.editor.replaceDocument(doc); - - this.setText(source.get("text")); - this.editor.setMode((0, _source.getMode)(source.toJS())); + this.state.editor.replaceDocument(this.state.editor.createDocument()); + this.state.editor.setText(msg); + this.state.editor.setMode({ name: "text" }); } renderHighlightLines() { @@ -25374,50 +24550,25 @@ return /******/ (function(modules) { // webpackBootstrap } return HighlightLines({ - editor: this.editor, + editor: this.state.editor, highlightedLineRange }); } - renderBreakpoints() { - var _props6 = this.props, - breakpoints = _props6.breakpoints, - selectedSource = _props6.selectedSource; - - - if (!selectedSource || selectedSource.get("loading") || !breakpoints || selectedSource && selectedSource.get("isBlackBoxed")) { - return; - } - - var breakpointMarkers = breakpoints.valueSeq().filter(b => (0, _devtoolsConfig.isEnabled)("columnBreakpoints") ? !b.location.column : true).map(bp => Breakpoint({ - key: (0, _breakpoint.makeLocationId)(bp.location), - breakpoint: bp, - editor: this.editor && this.editor.codeMirror - })); - - var columnBreakpointBookmarks = breakpoints.valueSeq().filter(b => (0, _devtoolsConfig.isEnabled)("columnBreakpoints") ? b.location.column : false).map(bp => ColumnBreakpoint({ - key: (0, _breakpoint.makeLocationId)(bp.location), - breakpoint: bp, - editor: this.editor && this.editor.codeMirror - })); - - return breakpointMarkers.concat(columnBreakpointBookmarks); - } - renderHitCounts() { var _props7 = this.props, hitCount = _props7.hitCount, selectedSource = _props7.selectedSource; - if (!selectedSource || selectedSource.get("loading") || !hitCount || !this.editor) { + if (!selectedSource || selectedSource.get("loading") || !hitCount || !this.state.editor) { return; } return hitCount.filter(marker => marker.get("count") > 0).map(marker => HitMarker({ key: marker.get("line"), hitData: marker.toJS(), - editor: this.editor.codeMirror + editor: this.state.editor.codeMirror })); } @@ -25449,7 +24600,7 @@ return /******/ (function(modules) { // webpackBootstrap selectedSource = _props9.selectedSource, selection = _props9.selection; - if (!this.editor || !selectedSource) { + if (!this.state.editor || !selectedSource) { return null; } @@ -25469,7 +24620,7 @@ return /******/ (function(modules) { // webpackBootstrap return Preview({ value, - editor: this.editor, + editor: this.state.editor, location: location, expression: expression, popoverPos: cursorPos, @@ -25484,9 +24635,9 @@ return /******/ (function(modules) { // webpackBootstrap return; } - this.editor.codeMirror.operation(() => { + this.state.editor.codeMirror.operation(() => { linesInScope.forEach(line => { - this.editor.codeMirror.addLineClass(line - 1, "line", "in-scope"); + this.state.editor.codeMirror.addLineClass(line - 1, "line", "in-scope"); }); }); } @@ -25499,6 +24650,15 @@ return /******/ (function(modules) { // webpackBootstrap return selectedFrame && selectedLocation && selectedFrame.location.sourceId == selectedLocation.sourceId; } + renderCallSites() { + var editor = this.state.editor; + + if (!editor || !(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) { + return null; + } + return CallSites({ editor }); + } + render() { var _props11 = this.props, selectSource = _props11.selectSource, @@ -25516,7 +24676,7 @@ return /******/ (function(modules) { // webpackBootstrap paused: !!pauseData && (0, _devtoolsConfig.isEnabled)("highlightScopeLines") }) }, SearchBar({ - editor: this.editor, + editor: this.state.editor, selectSource, selectedSource, highlightLineRange, @@ -25524,14 +24684,14 @@ return /******/ (function(modules) { // webpackBootstrap }), _react.DOM.div({ className: "editor-mount devtools-monospace", style: this.getInlineEditorStyles() - }), this.renderHighlightLines(), this.renderBreakpoints(), this.renderInScopeLines(), this.renderHitCounts(), Footer({ editor: this.editor, horizontal }), this.renderPreview()); + }), this.renderHighlightLines(), this.renderInScopeLines(), this.renderHitCounts(), Footer({ editor: this.state.editor, horizontal }), this.renderPreview(), this.renderCallSites(), Breakpoints({ editor: this.state.editor })); } } Editor.displayName = "Editor"; Editor.propTypes = { - breakpoints: _reactImmutableProptypes2.default.map.isRequired, + breakpoints: _reactImmutableProptypes2.default.map, hitCount: _react.PropTypes.object, selectedLocation: _react.PropTypes.object, selectedSource: _reactImmutableProptypes2.default.map, @@ -25551,7 +24711,6 @@ return /******/ (function(modules) { // webpackBootstrap coverageOn: _react.PropTypes.bool, pauseData: _react.PropTypes.object, selectedFrame: _react.PropTypes.object, - getExpression: _react.PropTypes.func.isRequired, addExpression: _react.PropTypes.func.isRequired, horizontal: _react.PropTypes.bool, query: _react.PropTypes.string.isRequired, @@ -25564,16 +24723,15 @@ return /******/ (function(modules) { // webpackBootstrap startPanelSize: _react.PropTypes.number, endPanelSize: _react.PropTypes.number, clearSelection: _react.PropTypes.func.isRequired, - linesInScope: _react.PropTypes.array + linesInScope: _react.PropTypes.array, + toggleBreakpoint: _react.PropTypes.func.isRequired, + toggleDisabledBreakpoint: _react.PropTypes.func.isRequired }; Editor.contextTypes = { shortcuts: _react.PropTypes.object }; - var expressionsSel = state => state.expressions.expressions; - var getExpressionSel = (0, _reselect.createSelector)(expressionsSel, expressions => input => expressions.find(exp => exp.input == input)); - exports.default = (0, _reactRedux.connect)(state => { var selectedLocation = (0, _selectors.getSelectedLocation)(state); var sourceId = selectedLocation && selectedLocation.sourceId; @@ -25583,17 +24741,16 @@ return /******/ (function(modules) { // webpackBootstrap selectedLocation, selectedSource, highlightedLineRange: (0, _selectors.getHighlightedLineRange)(state), - searchOn: (0, _selectors.getFileSearchState)(state), + searchOn: (0, _selectors.getActiveSearchState)(state) === "file", loadedObjects: (0, _selectors.getLoadedObjects)(state), - breakpoints: (0, _selectors.getBreakpointsForSource)(state, sourceId || ""), + breakpoints: (0, _selectors.getVisibleBreakpoints)(state), hitCount: (0, _selectors.getHitCountForSource)(state, sourceId), selectedFrame: (0, _selectors.getSelectedFrame)(state), - getExpression: getExpressionSel(state), pauseData: (0, _selectors.getPause)(state), coverageOn: (0, _selectors.getCoverageEnabled)(state), query: (0, _selectors.getFileSearchQueryState)(state), searchModifiers: (0, _selectors.getFileSearchModifierState)(state), - linesInScope: (0, _linesInScope2.default)(state), + linesInScope: (0, _selectors.getInScopeLines)(state), selection: (0, _selectors.getSelection)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Editor); @@ -25868,8 +25025,6 @@ return /******/ (function(modules) { // webpackBootstrap var _redux = __webpack_require__(3); - var _fuzzaldrinPlus = __webpack_require__(161); - var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); @@ -25900,10 +25055,6 @@ return /******/ (function(modules) { // webpackBootstrap var _SearchInput3 = _interopRequireDefault(_SearchInput2); - var _ResultList2 = __webpack_require__(383); - - var _ResultList3 = _interopRequireDefault(_ResultList2); - __webpack_require__(653); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } @@ -25912,28 +25063,14 @@ return /******/ (function(modules) { // webpackBootstrap var SearchInput = (0, _react.createFactory)(_SearchInput3.default); - var ResultList = (0, _react.createFactory)(_ResultList3.default); - - function formatSymbol(symbol) { - return { - id: `${symbol.name}:${symbol.location.start.line}`, - title: symbol.name, - subtitle: `:${symbol.location.start.line}`, - value: symbol.name, - location: symbol.location - }; - } - function getShortcuts() { var searchAgainKey = L10N.getStr("sourceSearch.search.again.key2"); var searchAgainPrevKey = L10N.getStr("sourceSearch.search.againPrev.key2"); - var fnSearchKey = L10N.getStr("symbolSearch.search.key2"); var searchKey = L10N.getStr("sourceSearch.search.key2"); return { shiftSearchAgainShortcut: searchAgainPrevKey, searchAgainShortcut: searchAgainKey, - symbolSearchShortcut: fnSearchKey, searchShortcut: searchKey }; } @@ -25953,28 +25090,16 @@ return /******/ (function(modules) { // webpackBootstrap self.clearSearch = this.clearSearch.bind(this); self.closeSearch = this.closeSearch.bind(this); self.toggleSearch = this.toggleSearch.bind(this); - self.toggleSymbolSearch = this.toggleSymbolSearch.bind(this); - self.toggleTextSearch = this.toggleTextSearch.bind(this); self.setSearchValue = this.setSearchValue.bind(this); self.selectSearchInput = this.selectSearchInput.bind(this); self.searchInput = this.searchInput.bind(this); - self.updateSymbolSearchResults = this.updateSymbolSearchResults.bind(this); self.doSearch = this.doSearch.bind(this); self.searchContents = this.searchContents.bind(this); - self.traverseSymbolResults = this.traverseSymbolResults.bind(this); - self.traverseCodeResults = this.traverseCodeResults.bind(this); self.traverseResults = this.traverseResults.bind(this); - self.selectResultItem = this.selectResultItem.bind(this); - self.onSelectResultItem = this.onSelectResultItem.bind(this); self.onChange = this.onChange.bind(this); self.onKeyUp = this.onKeyUp.bind(this); - self.onKeyDown = this.onKeyDown.bind(this); self.buildSummaryMsg = this.buildSummaryMsg.bind(this); - self.buildPlaceHolder = this.buildPlaceHolder.bind(this); self.renderSearchModifiers = this.renderSearchModifiers.bind(this); - self.renderSearchTypeToggle = this.renderSearchTypeToggle.bind(this); - self.renderBottomBar = this.renderBottomBar.bind(this); - self.renderResults = this.renderResults.bind(this); } componentWillUnmount() { @@ -25983,14 +25108,12 @@ return /******/ (function(modules) { // webpackBootstrap var _getShortcuts = getShortcuts(), searchShortcut = _getShortcuts.searchShortcut, searchAgainShortcut = _getShortcuts.searchAgainShortcut, - shiftSearchAgainShortcut = _getShortcuts.shiftSearchAgainShortcut, - symbolSearchShortcut = _getShortcuts.symbolSearchShortcut; + shiftSearchAgainShortcut = _getShortcuts.shiftSearchAgainShortcut; shortcuts.off(searchShortcut); shortcuts.off("Escape"); shortcuts.off(searchAgainShortcut); shortcuts.off(shiftSearchAgainShortcut); - shortcuts.off(symbolSearchShortcut); } componentDidMount() { @@ -26004,8 +25127,7 @@ return /******/ (function(modules) { // webpackBootstrap var _getShortcuts2 = getShortcuts(), searchShortcut = _getShortcuts2.searchShortcut, searchAgainShortcut = _getShortcuts2.searchAgainShortcut, - shiftSearchAgainShortcut = _getShortcuts2.shiftSearchAgainShortcut, - symbolSearchShortcut = _getShortcuts2.symbolSearchShortcut; + shiftSearchAgainShortcut = _getShortcuts2.shiftSearchAgainShortcut; shortcuts.on(searchShortcut, (_, e) => this.toggleSearch(e)); shortcuts.on("Escape", (_, e) => this.onEscape(e)); @@ -26013,11 +25135,6 @@ return /******/ (function(modules) { // webpackBootstrap shortcuts.on(shiftSearchAgainShortcut, (_, e) => this.traverseResults(e, true)); shortcuts.on(searchAgainShortcut, (_, e) => this.traverseResults(e, false)); - - shortcuts.on(symbolSearchShortcut, (_, e) => this.toggleSymbolSearch(e, { - toggle: false, - searchType: "functions" - })); } componentDidUpdate(prevProps, prevState) { @@ -26025,9 +25142,7 @@ return /******/ (function(modules) { // webpackBootstrap selectedSource = _props.selectedSource, query = _props.query, modifiers = _props.modifiers, - searchOn = _props.searchOn, - symbolSearchOn = _props.symbolSearchOn, - selectedSymbolType = _props.selectedSymbolType; + searchOn = _props.searchOn; var searchInput = this.searchInput(); @@ -26046,10 +25161,7 @@ return /******/ (function(modules) { // webpackBootstrap var changedFiles = selectedSource != prevProps.selectedSource && hasLoaded; var modifiersUpdated = modifiers && !modifiers.equals(prevProps.modifiers); - var isOpen = searchOn || symbolSearchOn; - var changedSearchType = selectedSymbolType != prevProps.selectedSymbolType || symbolSearchOn != prevProps.symbolSearchOn; - - if (isOpen && (doneLoading || changedFiles || modifiersUpdated || changedSearchType)) { + if (searchOn && (doneLoading || changedFiles || modifiersUpdated)) { this.doSearch(query); } } @@ -26074,16 +25186,13 @@ return /******/ (function(modules) { // webpackBootstrap var _props3 = this.props, editor = _props3.editor, setFileSearchQuery = _props3.setFileSearchQuery, - searchOn = _props3.searchOn, - symbolSearchOn = _props3.symbolSearchOn; + searchOn = _props3.searchOn; - if (editor && (searchOn || symbolSearchOn)) { + if (editor && searchOn) { setFileSearchQuery(""); this.clearSearch(); - this.props.toggleFileSearch(false); - this.props.toggleSymbolSearch(false); - this.props.setSelectedSymbolType("functions"); + this.props.setActiveSearch(); this.props.clearHighlightLineRange(); e.stopPropagation(); e.preventDefault(); @@ -26093,19 +25202,11 @@ return /******/ (function(modules) { // webpackBootstrap toggleSearch(e) { e.stopPropagation(); e.preventDefault(); - var _props4 = this.props, - editor = _props4.editor, - symbolSearchOn = _props4.symbolSearchOn; + var editor = this.props.editor; if (!this.props.searchOn) { - this.props.toggleFileSearch(); - } - - if (symbolSearchOn) { - this.clearSearch(); - this.props.toggleSymbolSearch(false); - this.props.setSelectedSymbolType("functions"); + this.props.setActiveSearch("file"); } if (this.props.searchOn && editor) { @@ -26118,56 +25219,6 @@ return /******/ (function(modules) { // webpackBootstrap } } - ignoreEvent(e) { - if (e) { - e.preventDefault(); - e.stopPropagation(); - } - } - - toggleSymbolSearch(e) { - var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, - toggle = _ref.toggle, - searchType = _ref.searchType; - - var selectedSource = this.props.selectedSource; - - if (!selectedSource) { - return; - } - this.ignoreEvent(e); - - if (this.props.symbolSearchOn) { - if (toggle) { - this.props.toggleSymbolSearch(false); - } else { - this.props.setSelectedSymbolType(searchType); - } - return; - } - - this.clearSearch(); - this.props.toggleSymbolSearch(true); - this.props.setSelectedSymbolType(searchType); - } - - toggleTextSearch(e) { - var selectedSource = this.props.selectedSource; - - this.ignoreEvent(e); - - if (!selectedSource) { - return; - } - - if (!this.props.searchOn) { - this.props.toggleFileSearch(); - } - - this.clearSearch(); - this.props.toggleSymbolSearch(false); - } - setSearchValue(value) { var searchInput = this.searchInput(); if (value == "" || !searchInput) { @@ -26196,32 +25247,10 @@ return /******/ (function(modules) { // webpackBootstrap return null; } - updateSymbolSearchResults(query) { - var _props5 = this.props, - selectedSource = _props5.selectedSource, - updateSearchResults = _props5.updateSearchResults, - updateSymbolSearchResults = _props5.updateSymbolSearchResults, - selectedSymbolType = _props5.selectedSymbolType, - symbols = _props5.symbols; - - - if (query == "" || !selectedSource) { - return; - } - - var symbolSearchResults = (0, _fuzzaldrinPlus.filter)(symbols[selectedSymbolType], query, { - key: "value" - }); - - updateSearchResults({ count: symbolSearchResults.length }); - updateSymbolSearchResults(symbolSearchResults); - } - doSearch(query) { - var _props6 = this.props, - selectedSource = _props6.selectedSource, - setFileSearchQuery = _props6.setFileSearchQuery, - ed = _props6.editor; + var _props4 = this.props, + selectedSource = _props4.selectedSource, + setFileSearchQuery = _props4.setFileSearchQuery; if (!selectedSource || !selectedSource.get("text")) { return; @@ -26229,22 +25258,27 @@ return /******/ (function(modules) { // webpackBootstrap setFileSearchQuery(query); - if (this.props.symbolSearchOn) { - return this.updateSymbolSearchResults(query); - } else if (ed) { - this.searchContents(query); - } + this.searchContents(query); + } + + updateSearchResults(characterIndex, line, matches) { + var matchIndex = matches.findIndex(elm => elm.line === line && elm.ch === characterIndex); + this.props.updateSearchResults({ + matches, + matchIndex, + count: matches.length, + index: characterIndex + }); } searchContents(query) { var _this = this; return _asyncToGenerator(function* () { - var _props7 = _this.props, - selectedSource = _props7.selectedSource, - modifiers = _props7.modifiers, - ed = _props7.editor, - index = _props7.searchResults.index; + var _props5 = _this.props, + selectedSource = _props5.selectedSource, + modifiers = _props5.modifiers, + ed = _props5.editor; if (!ed || !selectedSource || !selectedSource.get("text") || !modifiers) { @@ -26253,46 +25287,20 @@ return /******/ (function(modules) { // webpackBootstrap var ctx = { ed, cm: ed.codeMirror }; - var newCount = yield (0, _search.countMatches)(query, selectedSource.get("text"), modifiers.toJS()); + var _modifiers = modifiers.toJS(); + var matches = yield (0, _search.getMatches)(query, selectedSource.get("text"), _modifiers); - if (index == -1) { - (0, _editor.clearIndex)(ctx, query, modifiers.toJS()); - } + var _find = (0, _editor.find)(ctx, query, true, _modifiers), + ch = _find.ch, + line = _find.line; - var newIndex = (0, _editor.find)(ctx, query, true, modifiers.toJS()); - _this.props.updateSearchResults({ - count: newCount, - index: newIndex - }); + _this.updateSearchResults(ch, line, matches); })(); } - traverseSymbolResults(rev) { - var selectedResultIndex = this.state.selectedResultIndex; - - var searchResults = this.props.symbolSearchResults; - var resultCount = searchResults.length; - - if (rev) { - var nextResultIndex = Math.max(0, selectedResultIndex - 1); - - if (selectedResultIndex === 0) { - nextResultIndex = resultCount - 1; - } - this.setState({ selectedResultIndex: nextResultIndex }); - this.onSelectResultItem(searchResults[nextResultIndex]); - } else { - var _nextResultIndex = Math.min(resultCount - 1, selectedResultIndex + 1); - - if (selectedResultIndex === resultCount - 1) { - _nextResultIndex = 0; - } - this.setState({ selectedResultIndex: _nextResultIndex }); - this.onSelectResultItem(searchResults[_nextResultIndex]); - } - } - - traverseCodeResults(rev) { + traverseResults(e, rev) { + e.stopPropagation(); + e.preventDefault(); var ed = this.props.editor; if (!ed) { @@ -26301,85 +25309,28 @@ return /******/ (function(modules) { // webpackBootstrap var ctx = { ed, cm: ed.codeMirror }; - var _props8 = this.props, - query = _props8.query, - modifiers = _props8.modifiers, - updateSearchResults = _props8.updateSearchResults, - _props8$searchResults = _props8.searchResults, - count = _props8$searchResults.count, - index = _props8$searchResults.index; + var _props6 = this.props, + query = _props6.query, + modifiers = _props6.modifiers, + matches = _props6.searchResults.matches; if (query === "") { - this.props.toggleFileSearch(true); - } - - if (index == -1 && modifiers) { - (0, _editor.clearIndex)(ctx, query, modifiers.toJS()); + this.props.setActiveSearch("file"); } if (modifiers) { - var findFnc = rev ? _editor.findPrev : _editor.findNext; - var newIndex = findFnc(ctx, query, true, modifiers.toJS()); - updateSearchResults({ - index: newIndex, - count - }); + var matchedLocations = matches || []; + + var _ref = rev ? (0, _editor.findPrev)(ctx, query, true, modifiers.toJS()) : (0, _editor.findNext)(ctx, query, true, modifiers.toJS()), + ch = _ref.ch, + line = _ref.line; + + this.updateSearchResults(ch, line, matchedLocations); } } - traverseResults(e, rev) { - e.stopPropagation(); - e.preventDefault(); - - var symbolSearchOn = this.props.symbolSearchOn; - - - if (symbolSearchOn) { - return this.traverseSymbolResults(rev); - } - - this.traverseCodeResults(rev); - } - // Handlers - selectResultItem(e, item) { - var _props9 = this.props, - selectSource = _props9.selectSource, - selectedSource = _props9.selectedSource; - - - if (selectedSource) { - selectSource(selectedSource.get("id"), { - line: item.location.start.line - }); - - this.closeSearch(e); - } - } - - onSelectResultItem(item) { - var _props10 = this.props, - selectSource = _props10.selectSource, - selectedSource = _props10.selectedSource, - selectedSymbolType = _props10.selectedSymbolType, - highlightLineRange = _props10.highlightLineRange; - - - if (selectedSource && selectedSymbolType !== "functions") { - selectSource(selectedSource.get("id"), { - line: item.location.start.line - }); - } - - if (selectedSource && selectedSymbolType === "functions") { - highlightLineRange({ - start: item.location.start.line, - end: item.location.end.line, - sourceId: selectedSource.get("id") - }); - } - } onChange(e) { return this.doSearch(e.target.value); @@ -26393,55 +25344,14 @@ return /******/ (function(modules) { // webpackBootstrap this.traverseResults(e, e.shiftKey); e.preventDefault(); } - - onKeyDown(e) { - var _props11 = this.props, - symbolSearchOn = _props11.symbolSearchOn, - symbolSearchResults = _props11.symbolSearchResults; - - if (!symbolSearchOn || this.props.query == "") { - return; - } - - var searchResults = symbolSearchResults; - - if (e.key === "ArrowUp") { - this.traverseSymbolResults(true); - e.preventDefault(); - } else if (e.key === "ArrowDown") { - this.traverseSymbolResults(false); - e.preventDefault(); - } else if (e.key === "Enter") { - if (searchResults.length) { - this.selectResultItem(e, searchResults[this.state.selectedResultIndex]); - } - this.closeSearch(e); - e.preventDefault(); - } else if (e.key === "Tab") { - this.closeSearch(e); - e.preventDefault(); - } - } - // Renderers buildSummaryMsg() { - var _props12 = this.props, - symbolSearchOn = _props12.symbolSearchOn, - symbolSearchResults = _props12.symbolSearchResults; - - if (symbolSearchOn) { - if (symbolSearchResults.length > 1) { - return L10N.getFormatStr("editor.searchResults", this.state.selectedResultIndex + 1, symbolSearchResults.length); - } else if (symbolSearchResults.length === 1) { - return L10N.getFormatStr("editor.singleResult"); - } - } - - var _props13 = this.props, - _props13$searchResult = _props13.searchResults, - count = _props13$searchResult.count, - index = _props13$searchResult.index, - query = _props13.query; + var _props7 = this.props, + _props7$searchResults = _props7.searchResults, + matchIndex = _props7$searchResults.matchIndex, + count = _props7$searchResults.count, + index = _props7$searchResults.index, + query = _props7.query; if (query.trim() == "") { @@ -26456,39 +25366,21 @@ return /******/ (function(modules) { // webpackBootstrap return L10N.getFormatStr("sourceSearch.resultsSummary1", count); } - return L10N.getFormatStr("editor.searchResults", index + 1, count); - } - - buildPlaceHolder() { - var _props14 = this.props, - symbolSearchOn = _props14.symbolSearchOn, - selectedSymbolType = _props14.selectedSymbolType; - - if (symbolSearchOn) { - // prettier-ignore - return L10N.getFormatStr(`symbolSearch.search.${selectedSymbolType}Placeholder`); - } - - return L10N.getStr("sourceSearch.search.placeholder"); + return L10N.getFormatStr("editor.searchResults", matchIndex + 1, count); } renderSearchModifiers() { - var _props15 = this.props, - modifiers = _props15.modifiers, - toggleFileSearchModifier = _props15.toggleFileSearchModifier, - symbolSearchOn = _props15.symbolSearchOn; + var _props8 = this.props, + modifiers = _props8.modifiers, + toggleFileSearchModifier = _props8.toggleFileSearchModifier; - if (symbolSearchOn) { - return null; - } - function searchModBtn(modVal, className, svgName, tooltip) { return _react.DOM.button({ className: (0, _classnames2.default)(className, { - active: !symbolSearchOn && modifiers && modifiers.get(modVal) + active: modifiers && modifiers.get(modVal) }), - onClick: () => !symbolSearchOn ? toggleFileSearchModifier(modVal) : null, + onClick: () => toggleFileSearchModifier(modVal), title: tooltip }, (0, _Svg2.default)(svgName)); } @@ -26496,99 +25388,28 @@ return /******/ (function(modules) { // webpackBootstrap return _react.DOM.div({ className: "search-modifiers" }, searchModBtn("regexMatch", "regex-match-btn", "regex-match", L10N.getStr("symbolSearch.searchModifier.regex")), searchModBtn("caseSensitive", "case-sensitive-btn", "case-match", L10N.getStr("symbolSearch.searchModifier.caseSensitive")), searchModBtn("wholeWord", "whole-word-btn", "whole-word-match", L10N.getStr("symbolSearch.searchModifier.wholeWord"))); } - renderSearchTypeToggle() { - var toggleSymbolSearch = this.toggleSymbolSearch, - toggleTextSearch = this.toggleTextSearch; - var _props16 = this.props, - symbolSearchOn = _props16.symbolSearchOn, - selectedSymbolType = _props16.selectedSymbolType; - - - function isButtonActive(searchType) { - switch (searchType) { - case "functions": - case "variables": - return symbolSearchOn && selectedSymbolType == searchType; - // text search - default: - return !symbolSearchOn; - } - } - - function searchTextBtn() { - var searchType = "text"; - var active = isButtonActive(searchType); - - return _react.DOM.button({ - className: (0, _classnames2.default)("search-type-btn", { - active - }), - onClick: e => toggleTextSearch(e) - }, searchType); - } - - function searchTypeBtn(searchType) { - var active = isButtonActive(searchType); - var toggle = selectedSymbolType == searchType; - - return _react.DOM.button({ - className: (0, _classnames2.default)("search-type-btn", { - active - }), - onClick: e => toggleSymbolSearch(e, { toggle, searchType }) - }, searchType); - } - - return _react.DOM.section({ className: "search-type-toggles" }, _react.DOM.h1({ className: "search-toggle-title" }, L10N.getStr("editor.searchTypeToggleTitle")), searchTextBtn(), searchTypeBtn("functions"), searchTypeBtn("variables")); - } - - renderBottomBar() { - return _react.DOM.div({ className: "search-bottom-bar" }, this.renderSearchTypeToggle(), this.renderSearchModifiers()); - } - - renderResults() { - var selectedResultIndex = this.state.selectedResultIndex; - var _props17 = this.props, - query = _props17.query, - symbolSearchResults = _props17.symbolSearchResults, - symbolSearchOn = _props17.symbolSearchOn; - - if (query == "" || !symbolSearchOn || !symbolSearchResults.length) { - return; - } - - return ResultList({ - items: symbolSearchResults, - selected: selectedResultIndex, - selectItem: this.selectResultItem, - ref: "resultList" - }); - } - render() { - var _props18 = this.props, - count = _props18.searchResults.count, - query = _props18.query, - searchOn = _props18.searchOn, - symbolSearchOn = _props18.symbolSearchOn; + var _props9 = this.props, + count = _props9.searchResults.count, + query = _props9.query, + searchOn = _props9.searchOn; - if (!searchOn && !symbolSearchOn) { + if (!searchOn) { return _react.DOM.div(); } return _react.DOM.div({ className: "search-bar" }, SearchInput({ query, count, - placeholder: this.buildPlaceHolder(), + placeholder: L10N.getStr("sourceSearch.search.placeholder"), summaryMsg: this.buildSummaryMsg(), onChange: this.onChange, onKeyUp: this.onKeyUp, - onKeyDown: this.onKeyDown, handleNext: e => this.traverseResults(e, false), handlePrev: e => this.traverseResults(e, true), handleClose: this.closeSearch - }), this.renderResults(), this.renderBottomBar()); + }), _react.DOM.div({ className: "search-bottom-bar" }, this.renderSearchModifiers())); } } @@ -26597,32 +25418,12 @@ return /******/ (function(modules) { // webpackBootstrap shortcuts: _react.PropTypes.object }; - function _getFormattedSymbols(state) { - var source = (0, _selectors.getSelectedSource)(state); - if (!source) { - return { variables: [], functions: [] }; - } - - var _getSymbols = (0, _selectors.getSymbols)(state, source.toJS()), - variables = _getSymbols.variables, - functions = _getSymbols.functions; - - return { - variables: variables.map(formatSymbol), - functions: functions.map(formatSymbol) - }; - } - exports.default = (0, _reactRedux.connect)(state => { return { - searchOn: (0, _selectors.getFileSearchState)(state), + searchOn: (0, _selectors.getActiveSearchState)(state) === "file", query: (0, _selectors.getFileSearchQueryState)(state), modifiers: (0, _selectors.getFileSearchModifierState)(state), - symbolSearchOn: (0, _selectors.getSymbolSearchState)(state), - symbolSearchResults: (0, _selectors.getSymbolSearchResults)(state), - searchResults: (0, _selectors.getSearchResults)(state), - symbols: _getFormattedSymbols(state), - selectedSymbolType: (0, _selectors.getSymbolSearchType)(state) + searchResults: (0, _selectors.getSearchResults)(state) }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SearchBar); @@ -27394,47 +26195,44 @@ return /******/ (function(modules) { // webpackBootstrap var _devtoolsLaunchpad = __webpack_require__(131); function GutterMenu(_ref) { - var bp = _ref.bp, + var breakpoint = _ref.breakpoint, line = _ref.line, event = _ref.event, toggleBreakpoint = _ref.toggleBreakpoint, showConditionalPanel = _ref.showConditionalPanel, - toggleBreakpointDisabledStatus = _ref.toggleBreakpointDisabledStatus, + toggleDisabledBreakpoint = _ref.toggleDisabledBreakpoint, isCbPanelOpen = _ref.isCbPanelOpen, closeConditionalPanel = _ref.closeConditionalPanel; event.stopPropagation(); event.preventDefault(); - var breakpoint = { - id: "node-menu-add-breakpoint", - label: L10N.getStr("editor.addBreakpoint") - }, - conditional = { - id: "node-menu-add-conditional-breakpoint", - label: L10N.getStr("editor.addConditionalBreakpoint") - }, - disabled = void 0; - if (bp) { - breakpoint = { + + var gutterItems = { + addBreakpoint: { + id: "node-menu-add-breakpoint", + label: L10N.getStr("editor.addBreakpoint") + }, + addConditional: { + id: "node-menu-add-conditional-breakpoint", + label: L10N.getStr("editor.addConditionalBreakpoint") + }, + removeBreakpoint: { id: "node-menu-remove-breakpoint", label: L10N.getStr("editor.removeBreakpoint") - }; - conditional = { + }, + editConditional: { id: "node-menu-edit-conditional-breakpoint", label: L10N.getStr("editor.editBreakpoint") - }; - if (bp.disabled) { - disabled = { - id: "node-menu-enable-breakpoint", - label: L10N.getStr("editor.enableBreakpoint") - }; - } else { - disabled = { - id: "node-menu-disable-breakpoint", - label: L10N.getStr("editor.disableBreakpoint") - }; + }, + enableBreakpoint: { + id: "node-menu-enable-breakpoint", + label: L10N.getStr("editor.enableBreakpoint") + }, + disableBreakpoint: { + id: "node-menu-disable-breakpoint", + label: L10N.getStr("editor.disableBreakpoint") } - } + }; var toggleBreakpointItem = Object.assign({ accesskey: "B", @@ -27445,22 +26243,22 @@ return /******/ (function(modules) { // webpackBootstrap closeConditionalPanel(); } } - }, breakpoint); + }, breakpoint ? gutterItems.removeBreakpoint : gutterItems.addBreakpoint); var conditionalBreakpoint = Object.assign({ accesskey: "C", disabled: false, click: () => showConditionalPanel(line) - }, conditional); + }, breakpoint && breakpoint.condition ? gutterItems.editConditional : gutterItems.addConditional); var items = [toggleBreakpointItem, conditionalBreakpoint]; - if (bp) { + if (breakpoint) { var disableBreakpoint = Object.assign({ accesskey: "D", disabled: false, - click: () => toggleBreakpointDisabledStatus(line) - }, disabled); + click: () => toggleDisabledBreakpoint(line) + }, breakpoint.disabled ? gutterItems.enableBreakpoint : gutterItems.disableBreakpoint); items.push(disableBreakpoint); } @@ -28109,12 +26907,7 @@ return /******/ (function(modules) { // webpackBootstrap /* 685 */, /* 686 */, /* 687 */, -/* 688 */ -/***/ function(module, exports) { - - module.exports = "" - -/***/ }, +/* 688 */, /* 689 */, /* 690 */, /* 691 */, @@ -28463,9 +27256,9 @@ return /******/ (function(modules) { // webpackBootstrap var arrowOrientation = orientation === "up" ? "down" : "up"; var arrowProp = arrowOrientation === "up" ? "top" : "bottom"; - var arrowPropValue = arrowOrientation === "up" ? -8 : 6; + var arrowPropValue = arrowOrientation === "up" ? -7 : 5; - return new BracketArrow({ + return BracketArrow({ orientation: arrowOrientation, left, [arrowProp]: arrowPropValue @@ -28966,10 +27759,11 @@ return /******/ (function(modules) { // webpackBootstrap var _Svg2 = _interopRequireDefault(_Svg); + var _editor = __webpack_require__(257); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var breakpointSvg = document.createElement("div"); - _reactDom2.default.render((0, _Svg2.default)("breakpoint"), breakpointSvg); function makeMarker(isDisabled) { @@ -28990,20 +27784,40 @@ return /******/ (function(modules) { // webpackBootstrap } addBreakpoint() { - var bp = this.props.breakpoint; - var line = bp.location.line - 1; + var _props = this.props, + breakpoint = _props.breakpoint, + editor = _props.editor, + selectedSource = _props.selectedSource; - this.props.editor.setGutterMarker(line, "breakpoints", makeMarker(bp.disabled)); - this.props.editor.addLineClass(line, "line", "new-breakpoint"); - if (bp.condition) { - this.props.editor.addLineClass(line, "line", "has-condition"); + // NOTE: we need to wait for the breakpoint to be loaded + // to get the generated location + + if (!selectedSource || breakpoint.loading) { + return; + } + + var line = breakpoint.location.line - 1; + (0, _editor.showSourceText)(editor, selectedSource.toJS()); + + editor.codeMirror.setGutterMarker(line, "breakpoints", makeMarker(breakpoint.disabled)); + + editor.codeMirror.addLineClass(line, "line", "new-breakpoint"); + if (breakpoint.condition) { + editor.codeMirror.addLineClass(line, "line", "has-condition"); } else { - this.props.editor.removeLineClass(line, "line", "has-condition"); + editor.codeMirror.removeLineClass(line, "line", "has-condition"); } } + shouldComponentUpdate(nextProps) { - return this.props.editor !== nextProps.editor || this.props.breakpoint.disabled !== nextProps.breakpoint.disabled || this.props.breakpoint.condition !== nextProps.breakpoint.condition; + var _props2 = this.props, + editor = _props2.editor, + breakpoint = _props2.breakpoint, + selectedSource = _props2.selectedSource; + + return editor !== nextProps.editor || breakpoint.disabled !== nextProps.breakpoint.disabled || breakpoint.condition !== nextProps.breakpoint.condition || breakpoint.loading !== nextProps.breakpoint.loading || selectedSource !== nextProps.selectedSource; } + componentDidMount() { if (!this.props.editor) { return; @@ -29011,21 +27825,43 @@ return /******/ (function(modules) { // webpackBootstrap this.addBreakpoint(); } + componentDidUpdate() { this.addBreakpoint(); } + componentWillUnmount() { - if (!this.props.editor) { + var _props3 = this.props, + editor = _props3.editor, + breakpoint = _props3.breakpoint, + selectedSource = _props3.selectedSource; + + + if (!editor || !selectedSource) { return; } - var bp = this.props.breakpoint; - var line = bp.location.line - 1; + if (breakpoint.loading) { + return; + } - this.props.editor.setGutterMarker(line, "breakpoints", null); - this.props.editor.removeLineClass(line, "line", "new-breakpoint"); - this.props.editor.removeLineClass(line, "line", "has-condition"); + var line = breakpoint.location.line - 1; + var doc = (0, _editor.getDocument)(selectedSource.get("id")); + if (!doc) { + return; + } + + // NOTE: when we upgrade codemirror we can use `doc.setGutterMarker` + if (doc.setGutterMarker) { + doc.setGutterMarker(line, "breakpoints", null); + } else { + editor.codeMirror.setGutterMarker(line, "breakpoints", null); + } + + doc.removeLineClass(line, "line", "new-breakpoint"); + doc.removeLineClass(line, "line", "has-condition"); } + render() { return null; } @@ -29228,7 +28064,10 @@ return /******/ (function(modules) { // webpackBootstrap "aria-label": breakpointsDisabled ? L10N.getStr("breakpoints.enable") : L10N.getStr("breakpoints.disable"), className: boxClassName, disabled: breakpointsLoading, - onClick: () => toggleAllBreakpoints(!breakpointsDisabled), + onClick: e => { + e.stopPropagation(); + toggleAllBreakpoints(!breakpointsDisabled); + }, checked: !breakpointsDisabled && !isIndeterminate, ref: input => { if (input) { @@ -29340,8 +28179,7 @@ return /******/ (function(modules) { // webpackBootstrap render() { return _react.DOM.div({ - className: "secondary-panes", - style: { overflowX: "hidden" } + className: "secondary-panes" }, CommandBar(), this.props.horizontal ? this.renderHorizontalLayout() : this.renderVerticalLayout()); } } @@ -29507,7 +28345,7 @@ return /******/ (function(modules) { // webpackBootstrap } renderExpressionEditInput(expression) { - return _react.DOM.span({ className: "expression-input-container" }, _react.DOM.input({ + return _react.DOM.span({ className: "expression-input-container", key: expression.input }, _react.DOM.input({ type: "text", className: "input-expression", onKeyPress: e => this.inputKeyPress(e, expression), @@ -29639,6 +28477,8 @@ return /******/ (function(modules) { // webpackBootstrap var _redux = __webpack_require__(3); + var _devtoolsConfig = __webpack_require__(828); + var _reactImmutableProptypes = __webpack_require__(150); var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); @@ -29657,7 +28497,7 @@ return /******/ (function(modules) { // webpackBootstrap var _utils = __webpack_require__(234); - var _path = __webpack_require__(235); + var _source = __webpack_require__(233); var _Close = __webpack_require__(378); @@ -29681,11 +28521,13 @@ return /******/ (function(modules) { // webpackBootstrap return bpId === pausedId; } + function renderSourceLocation(source, line, column) { - var url = source.get("url") ? (0, _path.basename)(source.get("url")) : null; - var bpLocation = line + (column ? `:${column}` : ""); - // const line = url !== "" ? `: ${line}` : ""; - return url ? _react.DOM.div({ className: "location" }, `${(0, _utils.endTruncateStr)(url, 30)}: ${bpLocation}`) : null; + var filename = source ? (0, _source.getFilename)(source.toJS()) : null; + var columnVal = (0, _devtoolsConfig.isEnabled)("columnBreakpoints") && column ? `:${column}` : ""; + var bpLocation = `${line}${columnVal}`; + + return filename ? _react.DOM.div({ className: "location" }, `${(0, _utils.endTruncateStr)(filename, 30)}: ${bpLocation}`) : null; } class Breakpoints extends _react.PureComponent { @@ -30924,7 +29766,8 @@ return /******/ (function(modules) { // webpackBootstrap this.toggleSourcesDropdown = this.toggleSourcesDropdown.bind(this); this.renderDropdownSource = this.renderDropdownSource.bind(this); this.renderTabs = this.renderTabs.bind(this); - this.renderTab = this.renderTab.bind(this); + this.renderSourceTab = this.renderSourceTab.bind(this); + this.renderSearchTab = this.renderSearchTab.bind(this); this.renderNewButton = this.renderNewButton.bind(this); this.renderDropDown = this.renderDropdown.bind(this); this.renderStartPanelToggleButton = this.renderStartPanelToggleButton.bind(this); @@ -31110,21 +29953,62 @@ return /******/ (function(modules) { // webpackBootstrap renderTabs() { var sourceTabs = this.props.sourceTabs; + if (!sourceTabs) { return; } - return _react.DOM.div({ className: "source-tabs", ref: "sourceTabs" }, sourceTabs.map(this.renderTab)); + return _react.DOM.div({ className: "source-tabs", ref: "sourceTabs" }, sourceTabs.map(this.renderSourceTab)); } - renderTab(source) { + isProjectSearchEnabled() { + return this.props.activeSearch === "project"; + } + + isSourceSearchEnabled() { + return this.props.activeSearch === "source"; + } + + renderSearchTab(source) { var _props3 = this.props, - selectedSource = _props3.selectedSource, - selectSource = _props3.selectSource, - closeTab = _props3.closeTab; + closeTab = _props3.closeTab, + closeActiveSearch = _props3.closeActiveSearch, + setActiveSearch = _props3.setActiveSearch; + + + function tabName(tab) { + return `${tab} search results`; + } + + function onClickClose(ev) { + ev.stopPropagation(); + closeActiveSearch(); + closeTab(source); + } + return _react.DOM.div({ + className: (0, _classnames2.default)("source-tab", { + active: this.isProjectSearchEnabled() || this.isSourceSearchEnabled(), + pretty: false + }), + key: source, + onClick: () => setActiveSearch(source), + onContextMenu: e => this.onTabContextMenu(e, source), + title: tabName(source) + }, _react.DOM.div({ className: "filename" }, tabName(source)), (0, _Close2.default)({ + handleClick: onClickClose, + tooltip: L10N.getStr("sourceTabs.closeTabButtonTooltip") + })); + } + + renderSourceTab(source) { + var _props4 = this.props, + selectedSource = _props4.selectedSource, + selectSource = _props4.selectSource, + closeTab = _props4.closeTab, + closeActiveSearch = _props4.closeActiveSearch; var filename = (0, _source.getFilename)(source.toJS()); - var active = selectedSource && source.get("id") == selectedSource.get("id"); + var active = selectedSource && source.get("id") == selectedSource.get("id") && !this.isProjectSearchEnabled() && !this.isSourceSearchEnabled(); var isPrettyCode = (0, _source.isPretty)(source.toJS()); var sourceAnnotation = this.getSourceAnnotation(source); @@ -31139,7 +30023,10 @@ return /******/ (function(modules) { // webpackBootstrap pretty: isPrettyCode }), key: source.get("id"), - onClick: () => selectSource(source.get("id")), + onClick: () => { + closeActiveSearch(); + return selectSource(source.get("id")); + }, onContextMenu: e => this.onTabContextMenu(e, source.get("id")), title: (0, _source.getFilename)(source.toJS()) }, sourceAnnotation, _react.DOM.div({ className: "filename" }, filename), (0, _Close2.default)({ @@ -31152,7 +30039,12 @@ return /******/ (function(modules) { // webpackBootstrap var newTabTooltip = L10N.getFormatStr("sourceTabs.newTabButtonTooltip", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2"))); return _react.DOM.div({ className: "new-tab-btn", - onClick: () => this.props.toggleProjectSearch(), + onClick: () => { + if (this.props.searchOn) { + return this.props.closeActiveSearch(); + } + this.props.setActiveSearch("source"); + }, title: newTabTooltip }, (0, _Svg2.default)("plus")); } @@ -31210,8 +30102,10 @@ return /******/ (function(modules) { // webpackBootstrap exports.default = (0, _reactRedux.connect)(state => { return { selectedSource: (0, _selectors.getSelectedSource)(state), + searchTabs: (0, _selectors.getSearchTabs)(state), sourceTabs: (0, _selectors.getSourcesForTabs)(state), - searchOn: (0, _selectors.getProjectSearchState)(state) + activeSearch: (0, _selectors.getActiveSearchState)(state), + searchOn: (0, _selectors.getActiveSearchState)(state) === "source" }; }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourceTabs); @@ -31396,7 +30290,7 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; + exports.clearSymbols = exports.getOutOfScopeLocations = exports.getVariablesInScope = exports.getSymbols = exports.getClosestExpression = exports.stopParserWorker = exports.startParserWorker = undefined; var _devtoolsUtils = __webpack_require__(900); @@ -31411,6 +30305,7 @@ return /******/ (function(modules) { // webpackBootstrap var getSymbols = exports.getSymbols = dispatcher.task("getSymbols"); var getVariablesInScope = exports.getVariablesInScope = dispatcher.task("getVariablesInScope"); var getOutOfScopeLocations = exports.getOutOfScopeLocations = dispatcher.task("getOutOfScopeLocations"); + var clearSymbols = exports.clearSymbols = dispatcher.task("clearSymbols"); /***/ }, /* 828 */ @@ -32588,7 +31483,7 @@ return /******/ (function(modules) { // webpackBootstrap // bfcache) so explicity fire `newSource` events for all returned // sources. var sources = yield _commands.clientCommands.fetchSources(); - actions.connect(tabTarget._form.url); + actions.connect(tabTarget.url); yield actions.newSources(sources); // If the threadClient is already paused, make sure to show a @@ -32735,10 +31630,10 @@ return /******/ (function(modules) { // webpackBootstrap return { id: bpClient.actor, + condition, actualLocation: { line, column, - condition, sourceId: actor, sourceUrl: url } @@ -32763,6 +31658,10 @@ return /******/ (function(modules) { // webpackBootstrap actualLocation = (0, _create.createBreakpointLocation)(location, actualLocation); var id = (0, _breakpoint.makeLocationId)(actualLocation); bpClients[id] = bpClient; + bpClient.location.line = actualLocation.line; + bpClient.location.column = actualLocation.column; + bpClient.location.url = actualLocation.sourceUrl || ""; + return { id, actualLocation }; }); } @@ -32796,6 +31695,10 @@ return /******/ (function(modules) { // webpackBootstrap var frameId = _ref3.frameId; var params = frameId ? { frameActor: frameId } : {}; + if (!tabTarget || !tabTarget.activeConsole) { + return Promise.resolve(); + } + return new Promise(resolve => { tabTarget.activeConsole.evaluateJS(script, result => resolve(result), params); }); @@ -32968,7 +31871,7 @@ return /******/ (function(modules) { // webpackBootstrap return { sourceId: actualLocation.source.actor, - sourceUrl: location.sourceUrl, + sourceUrl: actualLocation.source.url, line: actualLocation.line, column: actualLocation.column }; @@ -33268,7 +32171,8 @@ return /******/ (function(modules) { // webpackBootstrap return { sourceId: serverLocation.scriptId, line: serverLocation.lineNumber + 1, - column: serverLocation.columnNumber + column: serverLocation.columnNumber, + sourceUrl: "" }; } } @@ -33496,6 +32400,8 @@ return /******/ (function(modules) { // webpackBootstrap var _App2 = _interopRequireDefault(_App); + var _prefs = __webpack_require__(226); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function bootstrapStore(client, services) { @@ -33508,6 +32414,8 @@ return /******/ (function(modules) { // webpackBootstrap }); var store = createStore((0, _redux.combineReducers)(_reducers2.default)); + store.subscribe(() => updatePrefs(store.getState())); + var actions = (0, _redux.bindActionCreators)(__webpack_require__(244).default, store.dispatch); return { store, actions, selectors: _selectors2.default }; @@ -33549,10 +32457,22 @@ return /******/ (function(modules) { // webpackBootstrap (0, _search.stopSearchWorker)(); } + function updatePrefs(state) { + var pendingBreakpoints = _selectors2.default.getPendingBreakpoints(state); + + if (_prefs.prefs.pendingBreakpoints !== pendingBreakpoints) { + _prefs.prefs.pendingBreakpoints = pendingBreakpoints; + } + } + /***/ }, /* 898 */ /***/ function(module, exports, __webpack_require__) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + const { originalToGeneratedId, generatedToOriginalId, @@ -33592,6 +32512,10 @@ return /******/ (function(modules) { // webpackBootstrap /* 899 */ /***/ function(module, exports, __webpack_require__) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + const md5 = __webpack_require__(248); function originalToGeneratedId(originalId) { @@ -33668,6 +32592,10 @@ return /******/ (function(modules) { // webpackBootstrap /* 900 */ /***/ function(module, exports, __webpack_require__) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + const networkRequest = __webpack_require__(901); const workerUtils = __webpack_require__(902); @@ -33680,6 +32608,10 @@ return /******/ (function(modules) { // webpackBootstrap /* 901 */ /***/ function(module, exports) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + function networkRequest(url, opts) { return new Promise((resolve, reject) => { const req = new XMLHttpRequest(); @@ -33689,7 +32621,7 @@ return /******/ (function(modules) { // webpackBootstrap if (req.status === 200) { resolve({ content: req.responseText }); } else { - resolve(req.statusText); + reject(req.statusText); } } }); @@ -33719,7 +32651,9 @@ return /******/ (function(modules) { // webpackBootstrap function WorkerDispatcher() { this.msgId = 1; this.worker = null; - } + } /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ WorkerDispatcher.prototype = { start(url) { @@ -33750,7 +32684,6 @@ return /******/ (function(modules) { // webpackBootstrap } this.worker.removeEventListener("message", listener); - if (result.error) { reject(result.error); } else { @@ -33852,19 +32785,22 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var lineOffset = 1; - function getTokenLocation(codeMirror, tokenEl) { var _tokenEl$getBoundingC = tokenEl.getBoundingClientRect(), left = _tokenEl$getBoundingC.left, - top = _tokenEl$getBoundingC.top; + top = _tokenEl$getBoundingC.top, + width = _tokenEl$getBoundingC.width, + height = _tokenEl$getBoundingC.height; - var _codeMirror$coordsCha = codeMirror.coordsChar({ left, top }), + var _codeMirror$coordsCha = codeMirror.coordsChar({ + left: left + width / 2, + top: top + height / 2 + }), line = _codeMirror$coordsCha.line, ch = _codeMirror$coordsCha.ch; return { - line: line + lineOffset, + line: line + 1, column: ch }; } @@ -33894,7 +32830,7 @@ return /******/ (function(modules) { // webpackBootstrap var invalidToken = tokenText === "" || tokenText.match(/[(){},.;\s]/); var invalidTarget = target.parentElement && !target.parentElement.closest(".CodeMirror-line") || cursorPos.top == 0; var isUpdating = selection && selection.updating; - var inScope = linesInScope.includes(location.line); + var inScope = linesInScope && linesInScope.includes(location.line); if (invalidTarget || !inScope || isUpdating || invalidToken) { return; @@ -34256,114 +33192,18 @@ return /******/ (function(modules) { // webpackBootstrap module.exports = "" /***/ }, -/* 921 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react = __webpack_require__(2); - - var _redux = __webpack_require__(3); - - var _reactRedux = __webpack_require__(151); - - var _classnames = __webpack_require__(175); - - var _classnames2 = _interopRequireDefault(_classnames); - - var _actions = __webpack_require__(244); - - var _actions2 = _interopRequireDefault(_actions); - - var _selectors = __webpack_require__(242); - - var _devtoolsConfig = __webpack_require__(828); - - __webpack_require__(922); - - var _previewFunction = __webpack_require__(701); - - var _previewFunction2 = _interopRequireDefault(_previewFunction); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - class Outline extends _react.Component { - - constructor(props) { - super(props); - this.state = {}; - } - - selectItem(location) { - var _props = this.props, - selectedSource = _props.selectedSource, - selectSource = _props.selectSource; - - if (!selectedSource) { - return; - } - var selectedSourceId = selectedSource.get("id"); - var startLine = location.start.line; - selectSource(selectedSourceId, { line: startLine }); - } - - renderFunction(func) { - var name = func.name, - location = func.location; - - - return _react.DOM.li({ - key: `${name}:${location.start.line}:${location.start.column}`, - className: "outline-list__element", - onClick: () => this.selectItem(location) - }, (0, _previewFunction2.default)({ name })); - } - - renderFunctions() { - var symbols = this.props.symbols; - - - return symbols.functions.filter(func => func.name != "anonymous").map(func => this.renderFunction(func)); - } - - render() { - var isHidden = this.props.isHidden; - - if (!(0, _devtoolsConfig.isEnabled)("outline")) { - return null; - } - - return _react.DOM.div({ className: (0, _classnames2.default)("outline", { hidden: isHidden }) }, _react.DOM.ul({ className: "outline-list" }, this.renderFunctions())); - } - } - - Outline.displayName = "Outline"; - - exports.default = (0, _reactRedux.connect)(state => { - var selectedSource = (0, _selectors.getSelectedSource)(state); - return { - symbols: (0, _selectors.getSymbols)(state, selectedSource && selectedSource.toJS()), - selectedSource - }; - }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Outline); - -/***/ }, -/* 922 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ }, +/* 921 */, +/* 922 */, /* 923 */, /* 924 */ /***/ function(module, exports, __webpack_require__) { "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + var _require = __webpack_require__(925), MODE = _require.MODE; @@ -34371,11 +33211,11 @@ return /******/ (function(modules) { // webpackBootstrap REPS = _require2.REPS, getRep = _require2.getRep; + var ObjectInspector = __webpack_require__(1154); + var _require3 = __webpack_require__(927), - createFactories = _require3.createFactories, parseURLEncodedText = _require3.parseURLEncodedText, parseURLParams = _require3.parseURLParams, - getSelectableInInspectorGrips = _require3.getSelectableInInspectorGrips, maybeEscapePropertyName = _require3.maybeEscapePropertyName, getGripPreviewItems = _require3.getGripPreviewItems; @@ -34383,12 +33223,11 @@ return /******/ (function(modules) { // webpackBootstrap REPS, getRep, MODE, - createFactories, maybeEscapePropertyName, parseURLEncodedText, parseURLParams, - getSelectableInInspectorGrips, - getGripPreviewItems + getGripPreviewItems, + ObjectInspector }; /***/ }, @@ -34397,6 +33236,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + module.exports = { MODE: { TINY: Symbol("TINY"), @@ -34411,6 +33254,12 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + __webpack_require__(1149); + var _require = __webpack_require__(927), isGrip = _require.isGrip; @@ -34463,7 +33312,7 @@ return /******/ (function(modules) { // webpackBootstrap var object = props.object, defaultRep = props.defaultRep; - var rep = getRep(object, defaultRep); + var rep = getRep(object, defaultRep, props.noGrip); return rep(props); }; @@ -34479,14 +33328,17 @@ return /******/ (function(modules) { // webpackBootstrap * * @param defaultObject {React.Component} The default template * that should be used to render given object if none is found. + * + * @param noGrip {Boolean} If true, will only check reps not made for remote objects. */ function getRep(object) { var defaultRep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Obj; + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; var type = typeof object; if (type == "object" && object instanceof String) { type = "string"; - } else if (object && type == "object" && object.type) { + } else if (object && type == "object" && object.type && noGrip !== true) { type = object.type; } @@ -34500,7 +33352,7 @@ return /******/ (function(modules) { // webpackBootstrap // supportsObject could return weight (not only true/false // but a number), which would allow to priorities templates and // support better extensibility. - if (rep.supportsObject(object, type)) { + if (rep.supportsObject(object, type, noGrip)) { return rep.rep; } } catch (err) { @@ -34556,25 +33408,13 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); - // Utils - var nodeConstants = __webpack_require__(928); - - /** - * Create React factories for given arguments. - * Example: - * const { Rep } = createFactories(require("./rep")); - */ - function createFactories(args) { - var result = {}; - for (var p in args) { - result[p] = React.createFactory(args[p]); - } - return result; - } - /** * Returns true if the given object is a grip (see RDP protocol) */ @@ -34832,44 +33672,6 @@ return /******/ (function(modules) { // webpackBootstrap return wrappedFunction; } - /** - * Get an array of all the items from the grip in parameter (including the grip itself) - * which can be selected in the inspector. - * - * @param {Object} Grip - * @return {Array} Flat array of the grips which can be selected in the inspector - */ - function getSelectableInInspectorGrips(grip) { - var grips = new Set(getFlattenedGrips([grip])); - return [].concat(_toConsumableArray(grips)).filter(isGripSelectableInInspector); - } - - /** - * Indicate if a Grip can be selected in the inspector, - * i.e. if it represents a node element. - * - * @param {Object} Grip - * @return {Boolean} - */ - function isGripSelectableInInspector(grip) { - return grip && typeof grip === "object" && grip.preview && [nodeConstants.TEXT_NODE, nodeConstants.ELEMENT_NODE].includes(grip.preview.nodeType); - } - - /** - * Get a flat array of all the grips and their preview items. - * - * @param {Array} Grips - * @return {Array} Flat array of the grips and their preview items - */ - function getFlattenedGrips(grips) { - return grips.reduce((res, grip) => { - var previewItems = getGripPreviewItems(grip); - var flatPreviewItems = previewItems.length > 0 ? getFlattenedGrips(previewItems) : []; - - return [].concat(_toConsumableArray(res), [grip], _toConsumableArray(flatPreviewItems)); - }, []); - } - /** * Get preview items from a Grip. * @@ -34932,42 +33734,7 @@ return /******/ (function(modules) { // webpackBootstrap return []; } - /** - * Returns a new element wrapped with a component, props.objectLink if it exists, - * or a span if there are multiple children, or directly the child if only one is passed. - * - * @param {Object} props A Rep "props" object that may contain `objectLink` - * and `object` properties. - * @param {Object} config Object to pass as props to the `objectLink` component. - * @param {...Element} children Elements to be wrapped with the `objectLink` component. - * @return {Element} Element, wrapped or not, depending if `objectLink` - * was supplied in props. - */ - function safeObjectLink(props, config) { - var _React$DOM; - - var objectLink = props.objectLink, - object = props.object; - - for (var _len = arguments.length, children = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { - children[_key - 2] = arguments[_key]; - } - - if (objectLink) { - return objectLink.apply(undefined, [Object.assign({ - object - }, config)].concat(children)); - } - - if ((!config || Object.keys(config).length === 0) && children.length === 1) { - return children[0]; - } - - return (_React$DOM = React.DOM).span.apply(_React$DOM, [config].concat(children)); - } - module.exports = { - createFactories, isGrip, cropString, rawCropString, @@ -34979,9 +33746,7 @@ return /******/ (function(modules) { // webpackBootstrap parseURLEncodedText, getFileName, getURLDisplayString, - getSelectableInInspectorGrips, maybeEscapePropertyName, - safeObjectLink, getGripPreviewItems }; @@ -34991,6 +33756,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + module.exports = { ELEMENT_NODE: 1, ATTRIBUTE_NODE: 2, @@ -35020,6 +33789,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -35040,11 +33813,13 @@ return /******/ (function(modules) { // webpackBootstrap }; function supportsObject(object, type) { - if (object && object.type && object.type == "undefined") { - return true; + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true) { + return false; } - return type == "undefined"; + return object && object.type && object.type == "undefined" || type == "undefined"; } // Exports from this module @@ -35060,6 +33835,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -35080,6 +33859,12 @@ return /******/ (function(modules) { // webpackBootstrap } function supportsObject(object, type) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true) { + return false; + } + if (object && object.type && object.type == "null") { return true; } @@ -35100,6 +33885,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -35173,6 +33962,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -35213,7 +34006,11 @@ return /******/ (function(modules) { // webpackBootstrap length = object.length; - var config = { className: "objectBox objectBox-string" }; + var config = { + "data-link-actor-id": object.actor, + className: "objectBox objectBox-string" + }; + if (style) { config.style = style; } @@ -35228,7 +34025,9 @@ return /******/ (function(modules) { // webpackBootstrap } function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } return object.type === "longString"; @@ -35246,6 +34045,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -35296,11 +34099,14 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); var _require = __webpack_require__(927), - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var Caption = __webpack_require__(935); @@ -35321,7 +34127,6 @@ return /******/ (function(modules) { // webpackBootstrap */ ArrayRep.propTypes = { mode: ModePropType, - objectLink: React.PropTypes.func, object: React.PropTypes.array.isRequired }; @@ -35342,18 +34147,15 @@ return /******/ (function(modules) { // webpackBootstrap items = [DOM.span({ className: "length" }, isEmpty ? "" : object.length)]; brackets = needSpace(false); } else { - var max = mode === MODE.SHORT ? 3 : 10; - items = arrayIterator(props, object, max); + items = arrayIterator(props, object, maxLengthMap.get(mode)); brackets = needSpace(items.length > 0); } return DOM.span.apply(DOM, [{ - className: "objectBox objectBox-array" }, safeObjectLink(props, { - className: "arrayLeftBracket", - object: object - }, brackets.left)].concat(_toConsumableArray(items), [safeObjectLink(props, { - className: "arrayRightBracket", - object: object + className: "objectBox objectBox-array" }, DOM.span({ + className: "arrayLeftBracket" + }, brackets.left)].concat(_toConsumableArray(items), [DOM.span({ + className: "arrayRightBracket" }, brackets.right), DOM.span({ className: "arrayProperties", role: "group" })])); @@ -35386,9 +34188,7 @@ return /******/ (function(modules) { // webpackBootstrap if (array.length > max) { items.push(Caption({ - object: safeObjectLink(props, { - object: props.object - }, array.length - max + " more…") + object: DOM.span({}, "more…") })); } @@ -35419,10 +34219,15 @@ return /******/ (function(modules) { // webpackBootstrap return Array.isArray(object) || Object.prototype.toString.call(object) === "[object Arguments]"; } + var maxLengthMap = new Map(); + maxLengthMap.set(MODE.SHORT, 3); + maxLengthMap.set(MODE.LONG, 10); + // Exports from this module module.exports = { rep: wrapRender(ArrayRep), - supportsObject + supportsObject, + maxLengthMap }; /***/ }, @@ -35431,6 +34236,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); var DOM = React.DOM; @@ -35463,11 +34272,14 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); var _require = __webpack_require__(927), - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var Caption = __webpack_require__(935); @@ -35488,7 +34300,6 @@ return /******/ (function(modules) { // webpackBootstrap object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - objectLink: React.PropTypes.func, title: React.PropTypes.string }; @@ -35500,16 +34311,16 @@ return /******/ (function(modules) { // webpackBootstrap return span({ className: "objectBox objectBox-object" }, getTitle(props, object)); } - return span.apply(undefined, [{ className: "objectBox objectBox-object" }, getTitle(props, object), safeObjectLink(props, { + return span.apply(undefined, [{ className: "objectBox objectBox-object" }, getTitle(props, object), span({ className: "objectLeftBrace" - }, " { ")].concat(_toConsumableArray(propsArray), [safeObjectLink(props, { + }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" }, " }")])); } function getTitle(props, object) { var title = props.title || object.class || "Object"; - return safeObjectLink(props, { className: "objectTitle" }, title); + return span({ className: "objectTitle" }, title); } function safePropIterator(props, object, max) { @@ -35544,25 +34355,39 @@ return /******/ (function(modules) { // webpackBootstrap interestingObject = Object.assign({}, interestingObject, getFilteredObject(object, max - Object.keys(interestingObject).length, (type, value) => !isInterestingProp(type, value))); } - var truncated = Object.keys(object).length > max; - var propsArray = getPropsArray(interestingObject, truncated); - if (truncated) { + var propsArray = getPropsArray(interestingObject); + if (Object.keys(object).length > max) { propsArray.push(Caption({ - object: safeObjectLink(props, {}, Object.keys(object).length - max + " more…") + object: span({}, "more…") })); } - return propsArray; + return unfoldProps(propsArray); + } + + function unfoldProps(items) { + return items.reduce((res, item, index) => { + if (Array.isArray(item)) { + res = res.concat(item); + } else { + res.push(item); + } + + // Interleave commas between elements + if (index !== items.length - 1) { + res.push(", "); + } + return res; + }, []); } /** * Get an array of components representing the properties of the object * * @param {Object} object - * @param {Boolean} truncated true if the object is truncated. * @return {Array} Array of PropRep. */ - function getPropsArray(object, truncated) { + function getPropsArray(object) { var propsArray = []; if (!object) { @@ -35576,8 +34401,7 @@ return /******/ (function(modules) { // webpackBootstrap mode, name, object: object[name], - equal: ": ", - delim: i !== objectKeys.length - 1 || truncated ? ", " : null + equal: ": " })); } @@ -35632,6 +34456,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -35657,11 +34485,8 @@ return /******/ (function(modules) { // webpackBootstrap name: React.PropTypes.oneOfType([React.PropTypes.string, React.PropTypes.object]).isRequired, // Equal character rendered between property name and value. equal: React.PropTypes.string, - // Delimiter character used to separate individual properties. - delim: React.PropTypes.string, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - objectLink: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func, @@ -35671,6 +34496,13 @@ return /******/ (function(modules) { // webpackBootstrap suppressQuotes: React.PropTypes.bool }; + /** + * Function that given a name, a delimiter and an object returns an array + * of React elements representing an object property (e.g. `name: value`) + * + * @param {Object} props + * @return {Array} Array of React elements. + */ function PropRep(props) { var Grip = __webpack_require__(938); @@ -35680,7 +34512,6 @@ return /******/ (function(modules) { // webpackBootstrap var name = props.name, mode = props.mode, equal = props.equal, - delim = props.delim, suppressQuotes = props.suppressQuotes; @@ -35700,16 +34531,9 @@ return /******/ (function(modules) { // webpackBootstrap })); } - var delimElement = void 0; - if (delim) { - delimElement = span({ - "className": "objectComma" - }, delim); - } - - return span({}, key, span({ + return [key, span({ "className": "objectEqual" - }, equal), Rep(Object.assign({}, props)), delimElement); + }, equal), Rep(Object.assign({}, props))]; } // Exports from this module @@ -35723,13 +34547,16 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); // Dependencies var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var Caption = __webpack_require__(935); @@ -35754,34 +34581,45 @@ return /******/ (function(modules) { // webpackBootstrap mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), isInterestingProp: React.PropTypes.func, title: React.PropTypes.string, - objectLink: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, - onInspectIconClick: React.PropTypes.func + onInspectIconClick: React.PropTypes.func, + noGrip: React.PropTypes.bool }; function GripRep(props) { - var object = props.object; - var propsArray = safePropIterator(props, object, props.mode === MODE.LONG ? 10 : 3); + var _props$mode = props.mode, + mode = _props$mode === undefined ? MODE.SHORT : _props$mode, + object = props.object; - if (props.mode === MODE.TINY) { - return span({ className: "objectBox objectBox-object" }, getTitle(props, object)); + + var config = { + "data-link-actor-id": object.actor, + className: "objectBox objectBox-object" + }; + + if (mode === MODE.TINY) { + return span(config, getTitle(props, object)); } - return span.apply(undefined, [{ className: "objectBox objectBox-object" }, getTitle(props, object), safeObjectLink(props, { + var propsArray = safePropIterator(props, object, maxLengthMap.get(mode)); + + return span.apply(undefined, [config, getTitle(props, object), span({ className: "objectLeftBrace" - }, " { ")].concat(_toConsumableArray(propsArray), [safeObjectLink(props, { + }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" }, " }")])); } function getTitle(props, object) { var title = props.title || object.class || "Object"; - return safeObjectLink(props, {}, title); + return span({ + className: "objectTitle" + }, title); } function safePropIterator(props, object, max) { - max = typeof max === "undefined" ? 3 : max; + max = typeof max === "undefined" ? maxLengthMap.get(MODE.SHORT) : max; try { return propIterator(props, object, max); } catch (err) { @@ -35823,21 +34661,36 @@ return /******/ (function(modules) { // webpackBootstrap })); } - var truncate = Object.keys(properties).length > max; // The server synthesizes some property names for a Proxy, like // and ; we don't want to quote these because, // as synthetic properties, they appear more natural when // unquoted. var suppressQuotes = object.class === "Proxy"; - var propsArray = getProps(props, properties, indexes, truncate, suppressQuotes); - if (truncate) { + var propsArray = getProps(props, properties, indexes, suppressQuotes); + if (Object.keys(properties).length > max || propertiesLength > max) { // There are some undisplayed props. Then display "more...". propsArray.push(Caption({ - object: safeObjectLink(props, {}, `${propertiesLength - max} more…`) + object: span({}, "more…") })); } - return propsArray; + return unfoldProps(propsArray); + } + + function unfoldProps(items) { + return items.reduce((res, item, index) => { + if (Array.isArray(item)) { + res = res.concat(item); + } else { + res.push(item); + } + + // Interleave commas between elements + if (index !== items.length - 1) { + res.push(", "); + } + return res; + }, []); } /** @@ -35846,12 +34699,11 @@ return /******/ (function(modules) { // webpackBootstrap * @param {Object} componentProps Grip Component props. * @param {Object} properties Properties of the object the Grip describes. * @param {Array} indexes Indexes of properties. - * @param {Boolean} truncate true if the grip will be truncated. * @param {Boolean} suppressQuotes true if we should suppress quotes * on property names. * @return {Array} Props. */ - function getProps(componentProps, properties, indexes, truncate, suppressQuotes) { + function getProps(componentProps, properties, indexes, suppressQuotes) { // Make indexes ordered by ascending. indexes.sort(function (a, b) { return a - b; @@ -35867,11 +34719,8 @@ return /******/ (function(modules) { // webpackBootstrap name, object: value, equal: ": ", - delim: i !== indexes.length - 1 || truncate ? ", " : null, defaultRep: Grip, - // Do not propagate title and objectLink to properties reps title: null, - objectLink: null, suppressQuotes })); }); @@ -35933,16 +34782,23 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } return object.preview && object.preview.ownProperties; } + var maxLengthMap = new Map(); + maxLengthMap.set(MODE.SHORT, 3); + maxLengthMap.set(MODE.LONG, 10); + // Grip is used in propIterator and has to be defined here. var Grip = { rep: wrapRender(GripRep), - supportsObject + supportsObject, + maxLengthMap }; // Exports from this module @@ -35954,6 +34810,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -35997,6 +34857,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -36017,7 +34881,10 @@ return /******/ (function(modules) { // webpackBootstrap }; function InfinityRep(props) { - return span({ className: "objectBox objectBox-number" }, props.object.type); + var object = props.object; + + + return span({ className: "objectBox objectBox-number" }, object.type); } function supportsObject(object, type) { @@ -36036,6 +34903,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -36071,6 +34942,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36078,7 +34953,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(931), @@ -36094,8 +34968,7 @@ return /******/ (function(modules) { // webpackBootstrap */ Attribute.propTypes = { - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function Attribute(props) { @@ -36103,7 +34976,10 @@ return /******/ (function(modules) { // webpackBootstrap var value = object.preview.value; - return safeObjectLink(props, { className: "objectLink-Attr" }, span({ className: "attrTitle" }, getTitle(object)), span({ className: "attrEqual" }, "="), StringRep({ object: value })); + return span({ + "data-link-actor-id": object.actor, + className: "objectLink-Attr" + }, span({ className: "attrTitle" }, getTitle(object)), span({ className: "attrEqual" }, "="), StringRep({ object: value })); } function getTitle(grip) { @@ -36112,7 +34988,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } @@ -36130,6 +35008,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36137,7 +35019,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; // Shortcuts @@ -36150,15 +35031,17 @@ return /******/ (function(modules) { // webpackBootstrap */ DateTime.propTypes = { - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function DateTime(props) { var grip = props.object; var date = void 0; try { - date = span({ className: "objectBox" }, getTitle(props, grip), span({ className: "Date" }, new Date(grip.preview.timestamp).toISOString())); + date = span({ + "data-link-actor-id": grip.actor, + className: "objectBox" + }, getTitle(grip), span({ className: "Date" }, new Date(grip.preview.timestamp).toISOString())); } catch (e) { date = span({ className: "objectBox" }, "Invalid Date"); } @@ -36166,13 +35049,17 @@ return /******/ (function(modules) { // webpackBootstrap return date; } - function getTitle(props, grip) { - return safeObjectLink(props, {}, grip.class + " "); + function getTitle(grip) { + return span({ + className: "objectTitle" + }, grip.class + " "); } // Registration function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } @@ -36191,6 +35078,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36199,7 +35090,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; // Shortcuts @@ -36212,14 +35102,16 @@ return /******/ (function(modules) { // webpackBootstrap */ Document.propTypes = { - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function Document(props) { var grip = props.object; - return span({ className: "objectBox objectBox-object" }, getTitle(props, grip), span({ className: "objectPropValue" }, getLocation(grip))); + return span({ + "data-link-actor-id": grip.actor, + className: "objectBox objectBox-object" + }, getTitle(grip), span({ className: "objectPropValue" }, getLocation(grip))); } function getLocation(grip) { @@ -36227,13 +35119,17 @@ return /******/ (function(modules) { // webpackBootstrap return location ? getURLDisplayString(location) : ""; } - function getTitle(props, grip) { - return safeObjectLink(props, {}, grip.class + " "); + function getTitle(grip) { + return span({ + className: "objectTitle" + }, grip.class + " "); } // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } @@ -36252,6 +35148,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36274,7 +35174,6 @@ return /******/ (function(modules) { // webpackBootstrap Event.propTypes = { object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, @@ -36341,7 +35240,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } @@ -36360,6 +35261,12 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + 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); } } + + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36368,7 +35275,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, cropString = _require.cropString, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; // Shortcuts @@ -36382,17 +35288,19 @@ return /******/ (function(modules) { // webpackBootstrap FunctionRep.propTypes = { object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + parameterNames: React.PropTypes.array }; function FunctionRep(props) { var grip = props.object; - return ( + return span.apply(undefined, [{ + "data-link-actor-id": grip.actor, + className: "objectBox objectBox-function", // Set dir="ltr" to prevent function parentheses from // appearing in the wrong direction - span({ dir: "ltr", className: "objectBox objectBox-function" }, getTitle(props, grip), summarizeFunction(grip)) - ); + dir: "ltr" + }, getTitle(props, grip), summarizeFunction(grip), "("].concat(_toConsumableArray(renderParams(props)), [")"])); } function getTitle(props, grip) { @@ -36404,17 +35312,35 @@ return /******/ (function(modules) { // webpackBootstrap title = "async " + title; } - return safeObjectLink(props, {}, title); + return span({ + className: "objectTitle" + }, title); } function summarizeFunction(grip) { var name = grip.userDisplayName || grip.displayName || grip.name || ""; - return cropString(name + "()", 100); + return cropString(name, 100); + } + + function renderParams(props) { + var _props$parameterNames = props.parameterNames, + parameterNames = _props$parameterNames === undefined ? [] : _props$parameterNames; + + + return parameterNames.filter(param => param).reduce((res, param, index, arr) => { + res.push(span({ className: "param" }, param)); + if (index < arr.length - 1) { + res.push(span({ className: "delimiter" }, ", ")); + } + return res; + }, []); } // Registration function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return type == "function"; } @@ -36436,13 +35362,16 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); // Dependencies var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var PropRep = __webpack_require__(937); @@ -36462,7 +35391,6 @@ return /******/ (function(modules) { // webpackBootstrap object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - objectLink: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func @@ -36473,28 +35401,34 @@ return /******/ (function(modules) { // webpackBootstrap var promiseState = object.promiseState; + var config = { + "data-link-actor-id": object.actor, + className: "objectBox objectBox-object" + }; + if (props.mode === MODE.TINY) { var _require3 = __webpack_require__(926), Rep = _require3.Rep; - return span({ className: "objectBox objectBox-object" }, getTitle(props, object), safeObjectLink(props, { + return span(config, getTitle(object), span({ className: "objectLeftBrace" - }, " { "), Rep({ object: promiseState.state }), safeObjectLink(props, { + }, " { "), Rep({ object: promiseState.state }), span({ className: "objectRightBrace" }, " }")); } var propsArray = getProps(props, promiseState); - return span.apply(undefined, [{ className: "objectBox objectBox-object" }, getTitle(props, object), safeObjectLink(props, { + return span.apply(undefined, [config, getTitle(object), span({ className: "objectLeftBrace" - }, " { ")].concat(_toConsumableArray(propsArray), [safeObjectLink(props, { + }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" }, " }")])); } - function getTitle(props, object) { - var title = object.class; - return safeObjectLink(props, {}, title); + function getTitle(object) { + return span({ + className: "objectTitle" + }, object.class); } function getProps(props, promiseState) { @@ -36503,22 +35437,30 @@ return /******/ (function(modules) { // webpackBootstrap keys.push("value"); } - return keys.map((key, i) => { + return keys.reduce((res, key, i) => { var object = promiseState[key]; - return PropRep(Object.assign({}, props, { + res = res.concat(PropRep(Object.assign({}, props, { mode: MODE.TINY, name: `<${key}>`, object, equal: ": ", - delim: i < keys.length - 1 ? ", " : null, suppressQuotes: true - })); - }); + }))); + + // Interleave commas between elements + if (i !== keys.length - 1) { + res.push(", "); + } + + return res; + }, []); } // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } return type === "Promise"; @@ -36536,6 +35478,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36543,7 +35489,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; /** @@ -36552,15 +35497,15 @@ return /******/ (function(modules) { // webpackBootstrap RegExp.propTypes = { - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function RegExp(props) { var object = props.object; - return safeObjectLink(props, { + return React.DOM.span({ + "data-link-actor-id": object.actor, className: "objectBox objectBox-regexp regexpSource" }, getSource(object)); } @@ -36571,7 +35516,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } @@ -36590,6 +35537,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36598,7 +35549,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; // Shortcuts @@ -36611,19 +35561,21 @@ return /******/ (function(modules) { // webpackBootstrap */ StyleSheet.propTypes = { - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function StyleSheet(props) { var grip = props.object; - return span({ className: "objectBox objectBox-object" }, getTitle(props, grip), span({ className: "objectPropValue" }, getLocation(grip))); + return span({ + "data-link-actor-id": grip.actor, + className: "objectBox objectBox-object" + }, getTitle(grip), span({ className: "objectPropValue" }, getLocation(grip))); } - function getTitle(props, grip) { + function getTitle(grip) { var title = "StyleSheet "; - return safeObjectLink(props, { className: "objectBox" }, title); + return span({ className: "objectBoxTitle" }, title); } function getLocation(grip) { @@ -36634,7 +35586,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } @@ -36654,6 +35608,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); @@ -36693,12 +35651,17 @@ return /******/ (function(modules) { // webpackBootstrap textContent = cropString(textContent, 50); } - return span({ className: "objectBox theme-comment" }, ``); + return span({ + className: "objectBox theme-comment", + "data-link-actor-id": object.actor + }, ``); } // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } return object.preview && object.preview.nodeType === nodeConstants.COMMENT_NODE; @@ -36718,6 +35681,10 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36725,14 +35692,13 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; var nodeConstants = __webpack_require__(928); - var Svg = __webpack_require__(952); + var Svg = __webpack_require__(1151); // Shortcuts var span = React.DOM.span; @@ -36747,8 +35713,7 @@ return /******/ (function(modules) { // webpackBootstrap mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, - onInspectIconClick: React.PropTypes.func, - objectLink: React.PropTypes.func + onInspectIconClick: React.PropTypes.func }; function ElementNode(props) { @@ -36762,7 +35727,10 @@ return /******/ (function(modules) { // webpackBootstrap var isInTree = object.preview && object.preview.isConnected === true; - var baseConfig = { className: "objectBox objectBox-node" }; + var baseConfig = { + "data-link-actor-id": object.actor, + className: "objectBox objectBox-node" + }; var inspectIcon = void 0; if (isInTree) { if (onDOMNodeMouseOver) { @@ -36788,7 +35756,7 @@ return /******/ (function(modules) { // webpackBootstrap } } - return span(baseConfig, safeObjectLink.apply(undefined, [props, {}].concat(_toConsumableArray(elements))), inspectIcon); + return span.apply(undefined, [baseConfig].concat(_toConsumableArray(elements), [inspectIcon])); } function getElements(grip, mode) { @@ -36810,18 +35778,16 @@ return /******/ (function(modules) { // webpackBootstrap } return elements; } - var attributeElements = Object.keys(attributes).sort(function getIdAndClassFirst(a1, a2) { - if ([a1, a2].includes("id")) { - return 3 * (a1 === "id" ? -1 : 1); - } - if ([a1, a2].includes("class")) { - return 2 * (a1 === "class" ? -1 : 1); - } - - // `id` and `class` excepted, - // we want to keep the same order that in `attributes`. - return 0; - }).reduce((arr, name, i, keys) => { + var attributeKeys = Object.keys(attributes); + if (attributeKeys.includes("class")) { + attributeKeys.splice(attributeKeys.indexOf("class"), 1); + attributeKeys.unshift("class"); + } + if (attributeKeys.includes("id")) { + attributeKeys.splice(attributeKeys.indexOf("id"), 1); + attributeKeys.unshift("id"); + } + var attributeElements = attributeKeys.reduce((arr, name, i, keys) => { var value = attributes[name]; var attribute = span({}, span({ className: "attr-name theme-fg-color2" }, `${name}`), `="`, span({ className: "attr-value theme-fg-color6" }, `${value}`), `"`); @@ -36833,7 +35799,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } return object.preview && object.preview.nodeType === nodeConstants.ELEMENT_NODE; @@ -36846,40 +35814,16 @@ return /******/ (function(modules) { // webpackBootstrap }; /***/ }, -/* 952 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - var React = __webpack_require__(2); - var InlineSVG = __webpack_require__(346); - - var svg = { - "open-inspector": __webpack_require__(688) - }; - - module.exports = function (name, props) { - // eslint-disable-line - if (!svg[name]) { - throw new Error("Unknown SVG: " + name); - } - var className = name; - if (props && props.className) { - className = `${name} ${props.className}`; - } - if (name === "subSettings") { - className = ""; - } - props = Object.assign({}, props, { className, src: svg[name] }); - return React.createElement(InlineSVG, props); - }; - -/***/ }, +/* 952 */, /* 953 */ /***/ function(module, exports, __webpack_require__) { "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -36888,13 +35832,12 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, cropString = _require.cropString, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; - var Svg = __webpack_require__(952); + var Svg = __webpack_require__(1151); // Shortcuts var DOM = React.DOM; @@ -36906,7 +35849,6 @@ return /******/ (function(modules) { // webpackBootstrap object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - objectLink: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func @@ -36921,7 +35863,10 @@ return /******/ (function(modules) { // webpackBootstrap onInspectIconClick = props.onInspectIconClick; - var baseConfig = { className: "objectBox objectBox-textNode" }; + var baseConfig = { + "data-link-actor-id": grip.actor, + className: "objectBox objectBox-textNode" + }; var inspectIcon = void 0; var isInTree = grip.preview && grip.preview.isConnected === true; @@ -36950,24 +35895,26 @@ return /******/ (function(modules) { // webpackBootstrap } if (mode === MODE.TINY) { - return DOM.span(baseConfig, getTitle(props, grip), inspectIcon); + return DOM.span(baseConfig, getTitle(grip), inspectIcon); } - return DOM.span(baseConfig, getTitle(props, grip), DOM.span({ className: "nodeValue" }, " ", `"${getTextContent(grip)}"`), inspectIcon); + return DOM.span(baseConfig, getTitle(grip), DOM.span({ className: "nodeValue" }, " ", `"${getTextContent(grip)}"`), inspectIcon); } function getTextContent(grip) { return cropString(grip.preview.textContent); } - function getTitle(props, grip) { + function getTitle(grip) { var title = "#text"; - return safeObjectLink(props, {}, title); + return DOM.span({}, title); } // Registration function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } @@ -36986,28 +35933,34 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); // Utils var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), MODE = _require2.MODE; + // Shortcuts + + + var span = React.DOM.span; + /** * Renders Error objects. */ - ErrorRep.propTypes = { object: React.PropTypes.object.isRequired, // @TODO Change this to Object.values once it's supported in Node's version of V8 - mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - objectLink: React.PropTypes.func + mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])) }; function ErrorRep(props) { @@ -37026,12 +35979,17 @@ return /******/ (function(modules) { // webpackBootstrap content = `${content}\nStack trace:\n${preview.stack}`; } - return safeObjectLink(props, { className: "objectBox-stackTrace" }, content); + return span({ + "data-link-actor-id": object.actor, + className: "objectBox-stackTrace" + }, content); } // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } return object.preview && type === "Error"; @@ -37049,6 +36007,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -37057,7 +36019,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var _require2 = __webpack_require__(925), @@ -37075,8 +36036,7 @@ return /******/ (function(modules) { // webpackBootstrap WindowRep.propTypes = { // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function WindowRep(props) { @@ -37084,16 +36044,21 @@ return /******/ (function(modules) { // webpackBootstrap object = props.object; + var config = { + "data-link-actor-id": object.actor, + className: "objectBox objectBox-Window" + }; + if (mode === MODE.TINY) { - return span({ className: "objectBox objectBox-Window" }, getTitle(props, object)); + return span(config, getTitle(object)); } - return span({ className: "objectBox objectBox-Window" }, getTitle(props, object), " ", span({ className: "objectPropValue" }, getLocation(object))); + return span(config, getTitle(object), " ", span({ className: "objectPropValue" }, getLocation(object))); } - function getTitle(props, object) { + function getTitle(object) { var title = object.displayClass || object.class || "Window"; - return safeObjectLink(props, { className: "objectBox" }, title); + return span({ className: "objectBoxTitle" }, title); } function getLocation(object) { @@ -37102,7 +36067,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(object, type) { - if (!isGrip(object)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(object)) { return false; } @@ -37121,6 +36088,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -37140,22 +36111,15 @@ return /******/ (function(modules) { // webpackBootstrap */ ObjectWithText.propTypes = { - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function ObjectWithText(props) { var grip = props.object; - return span({ className: "objectBox objectBox-" + getType(grip) }, getTitle(props, grip), span({ className: "objectPropValue" }, getDescription(grip))); - } - - function getTitle(props, grip) { - if (props.objectLink) { - return span({ className: "objectBox" }, props.objectLink({ - object: grip - }, getType(grip) + " ")); - } - return ""; + return span({ + "data-link-actor-id": grip.actor, + className: "objectBox objectBox-" + getType(grip) + }, span({ className: "objectPropValue" }, getDescription(grip))); } function getType(grip) { @@ -37168,7 +36132,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } @@ -37187,6 +36153,10 @@ return /******/ (function(modules) { // webpackBootstrap "use strict"; + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // ReactJS var React = __webpack_require__(2); @@ -37195,7 +36165,6 @@ return /******/ (function(modules) { // webpackBootstrap var _require = __webpack_require__(927), isGrip = _require.isGrip, getURLDisplayString = _require.getURLDisplayString, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; // Shortcuts @@ -37208,17 +36177,19 @@ return /******/ (function(modules) { // webpackBootstrap */ ObjectWithURL.propTypes = { - object: React.PropTypes.object.isRequired, - objectLink: React.PropTypes.func + object: React.PropTypes.object.isRequired }; function ObjectWithURL(props) { var grip = props.object; - return span({ className: "objectBox objectBox-" + getType(grip) }, getTitle(props, grip), span({ className: "objectPropValue" }, getDescription(grip))); + return span({ + "data-link-actor-id": grip.actor, + className: "objectBox objectBox-" + getType(grip) + }, getTitle(grip), span({ className: "objectPropValue" }, getDescription(grip))); } - function getTitle(props, grip) { - return safeObjectLink(props, { className: "objectBox" }, getType(grip) + " "); + function getTitle(grip) { + return span({ className: "objectTitle" }, getType(grip) + " "); } function getType(grip) { @@ -37231,7 +36202,9 @@ return /******/ (function(modules) { // webpackBootstrap // Registration function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } @@ -37252,12 +36225,15 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var Caption = __webpack_require__(935); @@ -37280,7 +36256,6 @@ return /******/ (function(modules) { // webpackBootstrap // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), provider: React.PropTypes.object, - objectLink: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, onInspectIconClick: React.PropTypes.func @@ -37301,10 +36276,12 @@ return /******/ (function(modules) { // webpackBootstrap if (mode === MODE.TINY) { var objectLength = getLength(object); var isEmpty = objectLength === 0; - items = [span({ className: "length" }, isEmpty ? "" : objectLength)]; + items = [span({ + className: "length" + }, isEmpty ? "" : objectLength)]; brackets = needSpace(false); } else { - var max = mode === MODE.SHORT ? 3 : 10; + var max = maxLengthMap.get(mode); items = arrayIterator(props, object, max); brackets = needSpace(items.length > 0); } @@ -37312,41 +36289,23 @@ return /******/ (function(modules) { // webpackBootstrap var title = getTitle(props, object); return span.apply(undefined, [{ - className: "objectBox objectBox-array" }, title, safeObjectLink(props, { + "data-link-actor-id": object.actor, + className: "objectBox objectBox-array" }, title, span({ className: "arrayLeftBracket" - }, brackets.left)].concat(_toConsumableArray(items), [safeObjectLink(props, { + }, brackets.left)].concat(_toConsumableArray(interleaveCommas(items)), [span({ className: "arrayRightBracket" }, brackets.right), span({ className: "arrayProperties", role: "group" })])); } - /** - * Renders array item. Individual values are separated by - * a delimiter (a comma by default). - */ - GripArrayItem.propTypes = { - delim: React.PropTypes.string, - object: React.PropTypes.oneOfType([React.PropTypes.object, React.PropTypes.number, React.PropTypes.string]).isRequired, - objectLink: React.PropTypes.func, - // @TODO Change this to Object.values once it's supported in Node's version of V8 - mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - provider: React.PropTypes.object, - onDOMNodeMouseOver: React.PropTypes.func, - onDOMNodeMouseOut: React.PropTypes.func, - onInspectIconClick: React.PropTypes.func - }; - - function GripArrayItem(props) { - var _require3 = __webpack_require__(926), - Rep = _require3.Rep; - - var delim = props.delim; - - - return span({}, Rep(Object.assign({}, props, { - mode: MODE.TINY - })), delim); + function interleaveCommas(items) { + return items.reduce((res, item, index) => { + if (index !== items.length - 1) { + return res.concat(item, ", "); + } + return res.concat(item); + }, []); } function getLength(grip) { @@ -37357,13 +36316,15 @@ return /******/ (function(modules) { // webpackBootstrap return grip.preview.length || grip.preview.childNodesLength || 0; } - function getTitle(props, object, context) { + function getTitle(props, object) { if (props.mode === MODE.TINY) { return ""; } var title = props.title || object.class || "Array"; - return safeObjectLink(props, {}, title + " "); + return span({ + className: "objectTitle" + }, title + " "); } function getPreviewItems(grip) { @@ -37375,6 +36336,9 @@ return /******/ (function(modules) { // webpackBootstrap } function arrayIterator(props, grip, max) { + var _require3 = __webpack_require__(926), + Rep = _require3.Rep; + var items = []; var gripLength = getLength(grip); @@ -37387,56 +36351,85 @@ return /******/ (function(modules) { // webpackBootstrap return items; } - var delim = void 0; - // number of grip preview items is limited to 10, but we may have more - // items in grip-array. - var delimMax = gripLength > previewItems.length ? previewItems.length : previewItems.length - 1; var provider = props.provider; - for (var i = 0; i < previewItems.length && i < max; i++) { + var emptySlots = 0; + var foldedEmptySlots = 0; + items = previewItems.reduce((res, itemGrip) => { + if (res.length >= max) { + return res; + } + + var object = void 0; try { - var itemGrip = previewItems[i]; - var value = provider ? provider.getValue(itemGrip) : itemGrip; + if (!provider && itemGrip === null) { + emptySlots++; + return res; + } - delim = i == delimMax ? "" : ", "; - - items.push(GripArrayItem(Object.assign({}, props, { - object: value, - delim: delim, - // Do not propagate title to array items reps - title: undefined - }))); + object = provider ? provider.getValue(itemGrip) : itemGrip; } catch (exc) { - items.push(GripArrayItem(Object.assign({}, props, { - object: exc, - delim: delim, + object = exc; + } + + if (emptySlots > 0) { + res.push(getEmptySlotsElement(emptySlots)); + foldedEmptySlots = foldedEmptySlots + emptySlots - 1; + emptySlots = 0; + } + + if (res.length < max) { + res.push(Rep(Object.assign({}, props, { + object, + mode: MODE.TINY, // Do not propagate title to array items reps title: undefined }))); } + + return res; + }, []); + + // Handle trailing empty slots if there are some. + if (items.length < max && emptySlots > 0) { + items.push(getEmptySlotsElement(emptySlots)); + foldedEmptySlots = foldedEmptySlots + emptySlots - 1; } - if (previewItems.length > max || gripLength > previewItems.length) { - var leftItemNum = gripLength - max > 0 ? gripLength - max : gripLength - previewItems.length; + + var itemsShown = items.length + foldedEmptySlots; + if (gripLength > itemsShown) { items.push(Caption({ - object: safeObjectLink(props, {}, leftItemNum + " more…") + object: span({}, "more…") })); } return items; } + function getEmptySlotsElement(number) { + // TODO: Use l10N - See https://github.com/devtools-html/reps/issues/141 + return `<${number} empty slot${number > 1 ? "s" : ""}>`; + } + function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && (grip.preview.kind == "ArrayLike" || type === "DocumentFragment"); } + var maxLengthMap = new Map(); + maxLengthMap.set(MODE.SHORT, 3); + maxLengthMap.set(MODE.LONG, 10); + // Exports from this module module.exports = { rep: wrapRender(GripArray), - supportsObject + supportsObject, + maxLengthMap }; /***/ }, @@ -37447,12 +36440,17 @@ return /******/ (function(modules) { // webpackBootstrap 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); } } + + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + // Dependencies var React = __webpack_require__(2); var _require = __webpack_require__(927), isGrip = _require.isGrip, - safeObjectLink = _require.safeObjectLink, wrapRender = _require.wrapRender; var Caption = __webpack_require__(935); @@ -37474,7 +36472,6 @@ return /******/ (function(modules) { // webpackBootstrap object: React.PropTypes.object, // @TODO Change this to Object.values once it's supported in Node's version of V8 mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])), - objectLink: React.PropTypes.func, isInterestingEntry: React.PropTypes.func, onDOMNodeMouseOver: React.PropTypes.func, onDOMNodeMouseOut: React.PropTypes.func, @@ -37483,23 +36480,33 @@ return /******/ (function(modules) { // webpackBootstrap }; function GripMap(props) { - var object = props.object; - var propsArray = safeEntriesIterator(props, object, props.mode === MODE.LONG ? 10 : 3); + var mode = props.mode, + object = props.object; - if (props.mode === MODE.TINY) { - return span({ className: "objectBox objectBox-object" }, getTitle(props, object)); + + var config = { + "data-link-actor-id": object.actor, + className: "objectBox objectBox-object" + }; + + if (mode === MODE.TINY) { + return span(config, getTitle(props, object)); } - return span({ className: "objectBox objectBox-object" }, getTitle(props, object), safeObjectLink(props, { + var propsArray = safeEntriesIterator(props, object, maxLengthMap.get(mode)); + + return span.apply(undefined, [config, getTitle(props, object), span({ className: "objectLeftBrace" - }, " { "), propsArray, safeObjectLink(props, { + }, " { ")].concat(_toConsumableArray(propsArray), [span({ className: "objectRightBrace" - }, " }")); + }, " }")])); } function getTitle(props, object) { var title = props.title || (object && object.class ? object.class : "Map"); - return safeObjectLink(props, {}, title); + return span({ + className: "objectTitle" + }, title); } function safeEntriesIterator(props, object, max) { @@ -37533,11 +36540,27 @@ return /******/ (function(modules) { // webpackBootstrap // There are some undisplayed entries. Then display "more…". entries.push(Caption({ key: "more", - object: safeObjectLink(props, {}, `${mapEntries.length - max} more…`) + object: span({}, "more…") })); } - return entries; + return unfoldEntries(entries); + } + + function unfoldEntries(items) { + return items.reduce((res, item, index) => { + if (Array.isArray(item)) { + res = res.concat(item); + } else { + res.push(item); + } + + // Interleave commas between elements + if (index !== items.length - 1) { + res.push(", "); + } + return res; + }, []); } /** @@ -37549,8 +36572,7 @@ return /******/ (function(modules) { // webpackBootstrap * @return {Array} Array of PropRep. */ function getEntries(props, entries, indexes) { - var objectLink = props.objectLink, - onDOMNodeMouseOver = props.onDOMNodeMouseOver, + var onDOMNodeMouseOver = props.onDOMNodeMouseOver, onDOMNodeMouseOut = props.onDOMNodeMouseOut, onInspectIconClick = props.onInspectIconClick; @@ -37568,15 +36590,10 @@ return /******/ (function(modules) { // webpackBootstrap var value = entryValue.value !== undefined ? entryValue.value : entryValue; return PropRep({ - // key, name: key, equal: ": ", object: value, - // Do not add a trailing comma on the last entry - // if there won't be a "more..." item. - delim: i < indexes.length - 1 || indexes.length < entries.length ? ", " : null, mode: MODE.TINY, - objectLink, onDOMNodeMouseOver, onDOMNodeMouseOut, onInspectIconClick @@ -37614,23 +36631,30 @@ return /******/ (function(modules) { // webpackBootstrap } function supportsObject(grip, type) { - if (!isGrip(grip)) { + var noGrip = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; + + if (noGrip === true || !isGrip(grip)) { return false; } return grip.preview && grip.preview.kind == "MapLike"; } + var maxLengthMap = new Map(); + maxLengthMap.set(MODE.SHORT, 3); + maxLengthMap.set(MODE.LONG, 10); + // Exports from this module module.exports = { rep: wrapRender(GripMap), - supportsObject + supportsObject, + maxLengthMap }; /***/ }, /* 960 */ /***/ function(module, exports) { - module.exports = "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# LOCALIZATION NOTE These strings are used inside the Debugger\n# which is available from the Web Developer sub-menu -> 'Debugger'.\n# The correct localization of this file might be to keep it in\n# English, or another language commonly spoken among web developers.\n# You want to make that choice consistent across the developer tools.\n# A good criteria is the language in which you'd find the best\n# documentation on web development on the web.\n\n# LOCALIZATION NOTE (collapsePanes): This is the tooltip for the button\n# that collapses the left and right panes in the debugger UI.\ncollapsePanes=Collapse panes\n\n# LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the\n# context menu to copy the source URL of file open.\ncopySourceUrl=Copy Source Url\n\n# LOCALIZATION NOTE (copySourceUrl.accesskey): Access key to copy the source URL of a file from\n# the context menu.\ncopySourceUrl.accesskey=u\n\n# LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the\n# context menu to copy the stack trace methods, file names and row number.\ncopyStackTrace=Copy Stack Trace\n\n# LOCALIZATION NOTE (copyStackTrace.accesskey): Access key to copy the stack trace data from\n# the context menu.\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step Over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step In %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step Out %S\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event Listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourcesPane.showSourcesTooltip): The tooltip shown when\n# the user will navigate to the source tree view.\nsourcesPane.showSourcesTooltip=Show sources\n\n# LOCALIZATION NOTE (sourcesPane.showOutlineTooltip): The tooltip shown when\n# the user will navigate to the source outline view.\nsourcesPane.showOutlineTooltip=Show outline\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.deleteAll=Remove all breakpoints\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove Breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call Stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not Paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse Rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand Rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=no results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next Result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous Result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add Breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable Breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable Breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove Breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit Breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add Conditional Breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable Framework Grouping\n\n# LOCALIZATION NOTE (framework.disableGrouping.accesskey): Access key to toggle\n# framework grouping from the context menu.\nframework.disableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the\n# context menu to enable framework grouping.\nframework.enableGrouping=Enable Framework Grouping\n\n# LOCALIZATION NOTE (framework.enableGrouping.accesskey): Access key to toggle\n# framework grouping from the context menu.\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add Watch Expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.closeTab.accesskey): Access key to close the currently select\n# source tab from the editor context menu item.\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close others\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs.accesskey): Access key to close other source tabs\n# from the editor context menu.\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close tabs to the right\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd.accesskey): Access key to close source tabs\n# after the selected tab from the editor context menu.\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close all tabs\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs.accesskey): Access key to close all tabs from the\n# editor context menu.\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in Tree\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree.accesskey): Access key to reveal a source in the\n# tree from the context menu.\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy Link Address\n\n# LOCALIZATION NOTE (sourceTabs.copyLink.accesskey): Access key to copy a link addresss from the\n# editor context menu.\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty Print Source\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint.accesskey): Access key to pretty print a source from\n# the editor context menu.\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox Source\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox Source\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox.accesskey): Access key to blackbox\n# an associated source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackbox.accesskey): Access key to blackbox\n# an associated source\nsourceFooter.blackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed Source\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes Unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not Paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt\n# e.g. Cmd+P to search. On a mac, we use the command unicode character.\n# On windows, it's ctrl.\nsources.search=%S to search\n\n# LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar\n# pane header.\nwatchExpressions.header=Watch Expressions\n\n# LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header\n# button for refreshing the expressions.\nwatchExpressions.refreshButton=Refresh\n\n# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's\n# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on\n# a mac we use the unicode character.\nwelcome.search=%S to search for sources\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search Sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults=No files matching %S found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText2=Error loading this URL: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous Sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n" + module.exports = "# This Source Code Form is subject to the terms of the Mozilla Public\n# License, v. 2.0. If a copy of the MPL was not distributed with this\n# file, You can obtain one at http://mozilla.org/MPL/2.0/.\n\n# LOCALIZATION NOTE These strings are used inside the Debugger\n# which is available from the Web Developer sub-menu -> 'Debugger'.\n# The correct localization of this file might be to keep it in\n# English, or another language commonly spoken among web developers.\n# You want to make that choice consistent across the developer tools.\n# A good criteria is the language in which you'd find the best\n# documentation on web development on the web.\n\n# LOCALIZATION NOTE (collapsePanes): This is the tooltip for the button\n# that collapses the left and right panes in the debugger UI.\ncollapsePanes=Collapse panes\n\n# LOCALIZATION NOTE (copySourceUrl): This is the text that appears in the\n# context menu to copy the source URL of file open.\ncopySourceUrl=Copy Source Url\n\n# LOCALIZATION NOTE (copySourceUrl.accesskey): Access key to copy the source URL of a file from\n# the context menu.\ncopySourceUrl.accesskey=u\n\n# LOCALIZATION NOTE (copyStackTrace): This is the text that appears in the\n# context menu to copy the stack trace methods, file names and row number.\ncopyStackTrace=Copy Stack Trace\n\n# LOCALIZATION NOTE (copyStackTrace.accesskey): Access key to copy the stack trace data from\n# the context menu.\ncopyStackTrace.accesskey=c\n\n# LOCALIZATION NOTE (expandPanes): This is the tooltip for the button\n# that expands the left and right panes in the debugger UI.\nexpandPanes=Expand panes\n\n# LOCALIZATION NOTE (pauseButtonTooltip): The tooltip that is displayed for the pause\n# button when the debugger is in a running state.\npauseButtonTooltip=Pause %S\n\n# LOCALIZATION NOTE (pausePendingButtonTooltip): The tooltip that is displayed for\n# the pause button after it's been clicked but before the next JavaScript to run.\npausePendingButtonTooltip=Waiting for next execution\n\n# LOCALIZATION NOTE (resumeButtonTooltip): The label that is displayed on the pause\n# button when the debugger is in a paused state.\nresumeButtonTooltip=Resume %S\n\n# LOCALIZATION NOTE (stepOverTooltip): The label that is displayed on the\n# button that steps over a function call.\nstepOverTooltip=Step Over %S\n\n# LOCALIZATION NOTE (stepInTooltip): The label that is displayed on the\n# button that steps into a function call.\nstepInTooltip=Step In %S\n\n# LOCALIZATION NOTE (stepOutTooltip): The label that is displayed on the\n# button that steps out of a function call.\nstepOutTooltip=Step Out %S\n\n# LOCALIZATION NOTE (noWorkersText): The text to display in the workers list\n# when there are no workers.\nnoWorkersText=This page has no workers.\n\n# LOCALIZATION NOTE (noSourcesText): The text to display in the sources list\n# when there are no sources.\nnoSourcesText=This page has no sources.\n\n# LOCALIZATION NOTE (noEventListenersText): The text to display in the events tab\n# when there are no events.\nnoEventListenersText=No event listeners to display\n\n# LOCALIZATION NOTE (eventListenersHeader): The text to display in the events\n# header.\neventListenersHeader=Event Listeners\n\n# LOCALIZATION NOTE (noStackFramesText): The text to display in the call stack tab\n# when there are no stack frames.\nnoStackFramesText=No stack frames to display\n\n# LOCALIZATION NOTE (eventCheckboxTooltip): The tooltip text to display when\n# the user hovers over the checkbox used to toggle an event breakpoint.\neventCheckboxTooltip=Toggle breaking on this event\n\n# LOCALIZATION NOTE (eventOnSelector): The text to display in the events tab\n# for every event item, between the event type and event selector.\neventOnSelector=on\n\n# LOCALIZATION NOTE (eventInSource): The text to display in the events tab\n# for every event item, between the event selector and listener's owner source.\neventInSource=in\n\n# LOCALIZATION NOTE (eventNodes): The text to display in the events tab when\n# an event is listened on more than one target node.\neventNodes=%S nodes\n\n# LOCALIZATION NOTE (eventNative): The text to display in the events tab when\n# a listener is added from plugins, thus getting translated to native code.\neventNative=[native code]\n\n# LOCALIZATION NOTE (*Events): The text to display in the events tab for\n# each group of sub-level event entries.\nanimationEvents=Animation\naudioEvents=Audio\nbatteryEvents=Battery\nclipboardEvents=Clipboard\ncompositionEvents=Composition\ndeviceEvents=Device\ndisplayEvents=Display\ndragAndDropEvents=Drag and Drop\ngamepadEvents=Gamepad\nindexedDBEvents=IndexedDB\ninteractionEvents=Interaction\nkeyboardEvents=Keyboard\nmediaEvents=HTML5 Media\nmouseEvents=Mouse\nmutationEvents=Mutation\nnavigationEvents=Navigation\npointerLockEvents=Pointer Lock\nsensorEvents=Sensor\nstorageEvents=Storage\ntimeEvents=Time\ntouchEvents=Touch\notherEvents=Other\n\n# LOCALIZATION NOTE (blackboxCheckboxTooltip2): The tooltip text to display when\n# the user hovers over the checkbox used to toggle blackboxing its associated\n# source.\nblackboxCheckboxTooltip2=Toggle blackboxing\n\n# LOCALIZATION NOTE (sources.search.key2): Key shortcut to open the search for\n# searching all the source files the debugger has seen.\nsources.search.key2=CmdOrCtrl+P\n\n# LOCALIZATION NOTE (sources.search.alt.key): A second key shortcut to open the\n# search for searching all the source files the debugger has seen.\nsources.search.alt.key=CmdOrCtrl+O\n\n# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the\n# full project text search for searching all the files the debugger has seen.\nprojectTextSearch.key=CmdOrCtrl+Shift+F\n\n# LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger\n# does not have any sources.\nsources.noSourcesAvailable=This page has no sources\n\n# LOCALIZATION NOTE (sourcesPane.showSourcesTooltip): The tooltip shown when\n# the user will navigate to the source tree view.\nsourcesPane.showSourcesTooltip=Show sources\n\n# LOCALIZATION NOTE (sourcesPane.showOutlineTooltip): The tooltip shown when\n# the user will navigate to the source outline view.\nsourcesPane.showOutlineTooltip=Show outline\n\n# LOCALIZATION NOTE (sourceSearch.search.key2): Key shortcut to open the search\n# for searching within a the currently opened files in the editor\nsourceSearch.search.key2=CmdOrCtrl+F\n\n# LOCALIZATION NOTE (sourceSearch.search.placeholder): placeholder text in\n# the source search input bar\nsourceSearch.search.placeholder=Search in file…\n\n# LOCALIZATION NOTE (sourceSearch.search.again.key2): Key shortcut to highlight\n# the next occurrence of the last search triggered from a source search\nsourceSearch.search.again.key2=CmdOrCtrl+G\n\n# LOCALIZATION NOTE (sourceSearch.search.againPrev.key2): Key shortcut to highlight\n# the previous occurrence of the last search triggered from a source search\nsourceSearch.search.againPrev.key2=CmdOrCtrl+Shift+G\n\n# LOCALIZATION NOTE (sourceSearch.resultsSummary1): Shows a summary of\n# the number of matches for autocomplete\nsourceSearch.resultsSummary1=%d results\n\n# LOCALIZATION NOTE (noMatchingStringsText): The text to display in the\n# global search results when there are no matching strings after filtering.\nnoMatchingStringsText=No matches found\n\n# LOCALIZATION NOTE (emptySearchText): This is the text that appears in the\n# filter text box when it is empty and the scripts container is selected.\nemptySearchText=Search scripts (%S)\n\n# LOCALIZATION NOTE (emptyVariablesFilterText): This is the text that\n# appears in the filter text box for the variables view container.\nemptyVariablesFilterText=Filter variables\n\n# LOCALIZATION NOTE (emptyPropertiesFilterText): This is the text that\n# appears in the filter text box for the editor's variables view bubble.\nemptyPropertiesFilterText=Filter properties\n\n# LOCALIZATION NOTE (searchPanelFilter): This is the text that appears in the\n# filter panel popup for the filter scripts operation.\nsearchPanelFilter=Filter scripts (%S)\n\n# LOCALIZATION NOTE (searchPanelGlobal): This is the text that appears in the\n# filter panel popup for the global search operation.\nsearchPanelGlobal=Search in all files (%S)\n\n# LOCALIZATION NOTE (searchPanelFunction): This is the text that appears in the\n# filter panel popup for the function search operation.\nsearchPanelFunction=Search for function definition (%S)\n\n# LOCALIZATION NOTE (searchPanelToken): This is the text that appears in the\n# filter panel popup for the token search operation.\nsearchPanelToken=Find in this file (%S)\n\n# LOCALIZATION NOTE (searchPanelGoToLine): This is the text that appears in the\n# filter panel popup for the line search operation.\nsearchPanelGoToLine=Go to line (%S)\n\n# LOCALIZATION NOTE (searchPanelVariable): This is the text that appears in the\n# filter panel popup for the variables search operation.\nsearchPanelVariable=Filter variables (%S)\n\n# LOCALIZATION NOTE (breakpointMenuItem): The text for all the elements that\n# are displayed in the breakpoints menu item popup.\nbreakpointMenuItem.setConditional=Configure conditional breakpoint\nbreakpointMenuItem.enableSelf=Enable breakpoint\nbreakpointMenuItem.disableSelf=Disable breakpoint\nbreakpointMenuItem.deleteSelf=Remove breakpoint\nbreakpointMenuItem.enableOthers=Enable others\nbreakpointMenuItem.disableOthers=Disable others\nbreakpointMenuItem.deleteOthers=Remove others\nbreakpointMenuItem.enableAll=Enable all breakpoints\nbreakpointMenuItem.disableAll=Disable all breakpoints\nbreakpointMenuItem.deleteAll=Remove all breakpoints\n\n# LOCALIZATION NOTE (breakpoints.header): Breakpoints right sidebar pane header.\nbreakpoints.header=Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.none): The text that appears when there are\n# no breakpoints present\nbreakpoints.none=No Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.enable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.enable=Enable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.disable): The text that may appear as a tooltip\n# when hovering over the 'disable breakpoints' switch button in right sidebar\nbreakpoints.disable=Disable Breakpoints\n\n# LOCALIZATION NOTE (breakpoints.removeBreakpointTooltip): The tooltip that is displayed\n# for remove breakpoint button in right sidebar\nbreakpoints.removeBreakpointTooltip=Remove Breakpoint\n\n# LOCALIZATION NOTE (callStack.header): Call Stack right sidebar pane header.\ncallStack.header=Call Stack\n\n# LOCALIZATION NOTE (callStack.notPaused): Call Stack right sidebar pane\n# message when not paused.\ncallStack.notPaused=Not Paused\n\n# LOCALIZATION NOTE (callStack.collapse): Call Stack right sidebar pane\n# message to hide some of the frames that are shown.\ncallStack.collapse=Collapse Rows\n\n# LOCALIZATION NOTE (callStack.expand): Call Stack right sidebar pane\n# message to show more of the frames.\ncallStack.expand=Expand Rows\n\n# LOCALIZATION NOTE (editor.searchResults): Editor Search bar message\n# for the summarizing the selected search result. e.g. 5 of 10 results.\neditor.searchResults=%d of %d results\n\n# LOCALIZATION NOTE (sourceSearch.singleResult): Copy shown when there is one result.\neditor.singleResult=1 result\n\n# LOCALIZATION NOTE (editor.noResults): Editor Search bar message\n# for when no results found.\neditor.noResults=no results\n\n# LOCALIZATION NOTE (editor.searchResults.nextResult): Editor Search bar\n# tooltip for traversing to the Next Result\neditor.searchResults.nextResult=Next Result\n\n# LOCALIZATION NOTE (editor.searchResults.prevResult): Editor Search bar\n# tooltip for traversing to the Previous Result\neditor.searchResults.prevResult=Previous Result\n\n# LOCALIZATION NOTE (editor.searchTypeToggleTitle): Search bar title for\n# toggling search type buttons(function search, variable search)\neditor.searchTypeToggleTitle=Search for:\n\n# LOCALIZATION NOTE (editor.addBreakpoint): Editor gutter context menu item\n# for adding a breakpoint on a line.\neditor.addBreakpoint=Add Breakpoint\n\n# LOCALIZATION NOTE (editor.disableBreakpoint): Editor gutter context menu item\n# for disabling a breakpoint on a line.\neditor.disableBreakpoint=Disable Breakpoint\n\n# LOCALIZATION NOTE (editor.enableBreakpoint): Editor gutter context menu item\n# for enabling a breakpoint on a line.\neditor.enableBreakpoint=Enable Breakpoint\n\n# LOCALIZATION NOTE (editor.removeBreakpoint): Editor gutter context menu item\n# for removing a breakpoint on a line.\neditor.removeBreakpoint=Remove Breakpoint\n\n# LOCALIZATION NOTE (editor.editBreakpoint): Editor gutter context menu item\n# for setting a breakpoint condition on a line.\neditor.editBreakpoint=Edit Breakpoint\n\n# LOCALIZATION NOTE (editor.addConditionalBreakpoint): Editor gutter context\n# menu item for adding a breakpoint condition on a line.\neditor.addConditionalBreakpoint=Add Conditional Breakpoint\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Placeholder text for\n# input element inside ConditionalPanel component\neditor.conditionalPanel.placeholder=This breakpoint will pause when the expression is true\n\n# LOCALIZATION NOTE (editor.conditionalPanel.placeholder): Tooltip text for\n# close button inside ConditionalPanel component\neditor.conditionalPanel.close=Cancel edit breakpoint and close\n\n# LOCALIZATION NOTE (editor.jumpToMappedLocation1): Context menu item\n# for navigating to a source mapped location\neditor.jumpToMappedLocation1=Jump to %S location\n\n# LOCALIZATION NOTE (framework.disableGrouping): This is the text that appears in the\n# context menu to disable framework grouping.\nframework.disableGrouping=Disable Framework Grouping\n\n# LOCALIZATION NOTE (framework.disableGrouping.accesskey): Access key to toggle\n# framework grouping from the context menu.\nframework.disableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (framework.enableGrouping): This is the text that appears in the\n# context menu to enable framework grouping.\nframework.enableGrouping=Enable Framework Grouping\n\n# LOCALIZATION NOTE (framework.enableGrouping.accesskey): Access key to toggle\n# framework grouping from the context menu.\nframework.enableGrouping.accesskey=u\n\n# LOCALIZATION NOTE (generated): Source Map term for a server source location\ngenerated=generated\n\n# LOCALIZATION NOTE (original): Source Map term for a debugger UI source location\noriginal=original\n\n# LOCALIZATION NOTE (expressions.placeholder): Placeholder text for expression\n# input element\nexpressions.placeholder=Add Watch Expression\n\n# LOCALIZATION NOTE (sourceTabs.closeTab): Editor source tab context menu item\n# for closing the selected tab below the mouse.\nsourceTabs.closeTab=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.closeTab.accesskey): Access key to close the currently select\n# source tab from the editor context menu item.\nsourceTabs.closeTab.accesskey=c\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs): Editor source tab context menu item\n# for closing the other tabs.\nsourceTabs.closeOtherTabs=Close others\n\n# LOCALIZATION NOTE (sourceTabs.closeOtherTabs.accesskey): Access key to close other source tabs\n# from the editor context menu.\nsourceTabs.closeOtherTabs.accesskey=o\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd): Editor source tab context menu item\n# for closing the tabs to the end (the right for LTR languages) of the selected tab.\nsourceTabs.closeTabsToEnd=Close tabs to the right\n\n# LOCALIZATION NOTE (sourceTabs.closeTabsToEnd.accesskey): Access key to close source tabs\n# after the selected tab from the editor context menu.\nsourceTabs.closeTabsToEnd.accesskey=e\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs): Editor source tab context menu item\n# for closing all tabs.\nsourceTabs.closeAllTabs=Close all tabs\n\n# LOCALIZATION NOTE (sourceTabs.closeAllTabs.accesskey): Access key to close all tabs from the\n# editor context menu.\nsourceTabs.closeAllTabs.accesskey=a\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree): Editor source tab context menu item\n# for revealing source in tree.\nsourceTabs.revealInTree=Reveal in Tree\n\n# LOCALIZATION NOTE (sourceTabs.revealInTree.accesskey): Access key to reveal a source in the\n# tree from the context menu.\nsourceTabs.revealInTree.accesskey=r\n\n# LOCALIZATION NOTE (sourceTabs.copyLink): Editor source tab context menu item\n# for copying a link address.\nsourceTabs.copyLink=Copy Link Address\n\n# LOCALIZATION NOTE (sourceTabs.copyLink.accesskey): Access key to copy a link addresss from the\n# editor context menu.\nsourceTabs.copyLink.accesskey=l\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint): Editor source tab context menu item\n# for pretty printing the source.\nsourceTabs.prettyPrint=Pretty Print Source\n\n# LOCALIZATION NOTE (sourceTabs.prettyPrint.accesskey): Access key to pretty print a source from\n# the editor context menu.\nsourceTabs.prettyPrint.accesskey=p\n\n# LOCALIZATION NOTE (sourceFooter.blackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.blackbox=Blackbox Source\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox): Tooltip text associated\n# with the blackbox button\nsourceFooter.unblackbox=Unblackbox Source\n\n# LOCALIZATION NOTE (sourceFooter.unblackbox.accesskey): Access key to blackbox\n# an associated source\nsourceFooter.unblackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackbox.accesskey): Access key to blackbox\n# an associated source\nsourceFooter.blackbox.accesskey=b\n\n# LOCALIZATION NOTE (sourceFooter.blackboxed): Text associated\n# with a blackboxed source\nsourceFooter.blackboxed=Blackboxed Source\n\n# LOCALIZATION NOTE (sourceTabs.closeTabButtonTooltip): The tooltip that is displayed\n# for close tab button in source tabs.\nsourceTabs.closeTabButtonTooltip=Close tab\n\n# LOCALIZATION NOTE (sourceTabs.newTabButtonTooltip): The tooltip that is displayed for\n# new tab button in source tabs.\nsourceTabs.newTabButtonTooltip=Search for sources (%S)\n\n# LOCALIZATION NOTE (scopes.header): Scopes right sidebar pane header.\nscopes.header=Scopes\n\n# LOCALIZATION NOTE (scopes.notAvailable): Scopes right sidebar pane message\n# for when the debugger is paused, but there isn't pause data.\nscopes.notAvailable=Scopes Unavailable\n\n# LOCALIZATION NOTE (scopes.notPaused): Scopes right sidebar pane message\n# for when the debugger is not paused.\nscopes.notPaused=Not Paused\n\n# LOCALIZATION NOTE (scopes.block): Refers to a block of code in\n# the scopes pane when the debugger is paused.\nscopes.block=Block\n\n# LOCALIZATION NOTE (sources.header): Sources left sidebar header\nsources.header=Sources\n\n# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt\n# e.g. Cmd+P to search. On a mac, we use the command unicode character.\n# On windows, it's ctrl.\nsources.search=%S to search\n\n# LOCALIZATION NOTE (watchExpressions.header): Watch Expressions right sidebar\n# pane header.\nwatchExpressions.header=Watch Expressions\n\n# LOCALIZATION NOTE (watchExpressions.refreshButton): Watch Expressions header\n# button for refreshing the expressions.\nwatchExpressions.refreshButton=Refresh\n\n# LOCALIZATION NOTE (welcome.search): The center pane welcome panel's\n# search prompt. e.g. cmd+p to search for files. On windows, it's ctrl, on\n# a mac we use the unicode character.\nwelcome.search=%S to search for sources\n\n# LOCALIZATION NOTE (sourceSearch.search): The center pane Source Search\n# prompt for searching for files.\nsourceSearch.search=Search Sources…\n\n# LOCALIZATION NOTE (sourceSearch.noResults): The center pane Source Search\n# message when the query did not match any of the sources.\nsourceSearch.noResults=No files matching %S found\n\n# LOCALIZATION NOTE (ignoreExceptions): The pause on exceptions button tooltip\n# when the debugger will not pause on exceptions.\nignoreExceptions=Ignore exceptions. Click to pause on uncaught exceptions\n\n# LOCALIZATION NOTE (pauseOnUncaughtExceptions): The pause on exceptions button\n# tooltip when the debugger will pause on uncaught exceptions.\npauseOnUncaughtExceptions=Pause on uncaught exceptions. Click to pause on all exceptions\n\n# LOCALIZATION NOTE (pauseOnExceptions): The pause on exceptions button tooltip\n# when the debugger will pause on all exceptions.\npauseOnExceptions=Pause on all exceptions. Click to ignore exceptions\n\n# LOCALIZATION NOTE (loadingText): The text that is displayed in the script\n# editor when the loading process has started but there is no file to display\n# yet.\nloadingText=Loading\\u2026\n\n# LOCALIZATION NOTE (errorLoadingText2): The text that is displayed in the debugger\n# viewer when there is an error loading a file\nerrorLoadingText2=Error loading this URL: %S\n\n# LOCALIZATION NOTE (addWatchExpressionText): The text that is displayed in the\n# watch expressions list to add a new item.\naddWatchExpressionText=Add watch expression\n\n# LOCALIZATION NOTE (addWatchExpressionButton): The button that is displayed in the\n# variables view popup.\naddWatchExpressionButton=Watch\n\n# LOCALIZATION NOTE (emptyVariablesText): The text that is displayed in the\n# variables pane when there are no variables to display.\nemptyVariablesText=No variables to display\n\n# LOCALIZATION NOTE (scopeLabel): The text that is displayed in the variables\n# pane as a header for each variable scope (e.g. \"Global scope, \"With scope\",\n# etc.).\nscopeLabel=%S scope\n\n# LOCALIZATION NOTE (watchExpressionsScopeLabel): The name of the watch\n# expressions scope. This text is displayed in the variables pane as a header for\n# the watch expressions scope.\nwatchExpressionsScopeLabel=Watch expressions\n\n# LOCALIZATION NOTE (globalScopeLabel): The name of the global scope. This text\n# is added to scopeLabel and displayed in the variables pane as a header for\n# the global scope.\nglobalScopeLabel=Global\n\n# LOCALIZATION NOTE (variablesViewErrorStacktrace): This is the text that is\n# shown before the stack trace in an error.\nvariablesViewErrorStacktrace=Stack trace:\n\n# LOCALIZATION NOTE (variablesViewMoreObjects): the text that is displayed\n# when you have an object preview that does not show all of the elements. At the end of the list\n# you see \"N more...\" in the web console output.\n# This is a semi-colon list of plural forms.\n# See: http://developer.mozilla.org/en/docs/Localization_and_Plurals\n# #1 number of remaining items in the object\n# example: 3 more…\nvariablesViewMoreObjects=#1 more…;#1 more…\n\n# LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed\n# in the variables list on an item with an editable name.\nvariablesEditableNameTooltip=Double click to edit\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in the variables list on an item with an editable value.\nvariablesEditableValueTooltip=Click to change value\n\n# LOCALIZATION NOTE (variablesCloseButtonTooltip): The text that is displayed\n# in the variables list on an item which can be removed.\nvariablesCloseButtonTooltip=Click to remove\n\n# LOCALIZATION NOTE (variablesEditButtonTooltip): The text that is displayed\n# in the variables list on a getter or setter which can be edited.\nvariablesEditButtonTooltip=Click to set value\n\n# LOCALIZATION NOTE (variablesEditableValueTooltip): The text that is displayed\n# in a tooltip on the \"open in inspector\" button in the the variables list for a\n# DOMNode item.\nvariablesDomNodeValueTooltip=Click to select the node in the inspector\n\n# LOCALIZATION NOTE (configurable|...|Tooltip): The text that is displayed\n# in the variables list on certain variables or properties as tooltips.\n# Expanations of what these represent can be found at the following links:\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen\n# https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed\n# It's probably best to keep these in English.\nconfigurableTooltip=configurable\nenumerableTooltip=enumerable\nwritableTooltip=writable\nfrozenTooltip=frozen\nsealedTooltip=sealed\nextensibleTooltip=extensible\noverriddenTooltip=overridden\nWebIDLTooltip=WebIDL\n\n# LOCALIZATION NOTE (variablesSeparatorLabel): The text that is displayed\n# in the variables list as a separator between the name and value.\nvariablesSeparatorLabel=:\n\n# LOCALIZATION NOTE (watchExpressionsSeparatorLabel2): The text that is displayed\n# in the watch expressions list as a separator between the code and evaluation.\nwatchExpressionsSeparatorLabel2=\\u0020→\n\n# LOCALIZATION NOTE (functionSearchSeparatorLabel): The text that is displayed\n# in the functions search panel as a separator between function's inferred name\n# and its real name (if available).\nfunctionSearchSeparatorLabel=←\n\n# LOCALIZATION NOTE(symbolSearch.search.functionsPlaceholder): The placeholder\n# text displayed when the user searches for functions in a file\nsymbolSearch.search.functionsPlaceholder=Search functions…\n\n# LOCALIZATION NOTE(symbolSearch.search.variablesPlaceholder): The placeholder\n# text displayed when the user searches for variables in a file\nsymbolSearch.search.variablesPlaceholder=Search variables…\n\n# LOCALIZATION NOTE(symbolSearch.search.key2): The Key Shortcut for\n# searching for a function or variable\nsymbolSearch.search.key2=CmdOrCtrl+Shift+O\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.regex): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.regex=Regex\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.caseSensitive): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.caseSensitive=Case sensitive\n\n# LOCALIZATION NOTE(symbolSearch.searchModifier.wholeWord): A search option\n# when searching text in a file\nsymbolSearch.searchModifier.wholeWord=Whole word\n\n# LOCALIZATION NOTE (resumptionOrderPanelTitle): This is the text that appears\n# as a description in the notification panel popup, when multiple debuggers are\n# open in separate tabs and the user tries to resume them in the wrong order.\n# The substitution parameter is the URL of the last paused window that must be\n# resumed first.\nresumptionOrderPanelTitle=There are one or more paused debuggers. Please resume the most-recently paused debugger first at: %S\n\nvariablesViewOptimizedOut=(optimized away)\nvariablesViewUninitialized=(uninitialized)\nvariablesViewMissingArgs=(unavailable)\n\nanonymousSourcesLabel=Anonymous Sources\n\nexperimental=This is an experimental feature\n\n# LOCALIZATION NOTE (whyPaused.debuggerStatement): The text that is displayed\n# in a info block explaining how the debugger is currently paused due to a `debugger`\n# statement in the code\nwhyPaused.debuggerStatement=Paused on debugger statement\n\n# LOCALIZATION NOTE (whyPaused.breakpoint): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a breakpoint\nwhyPaused.breakpoint=Paused on breakpoint\n\n# LOCALIZATION NOTE (whyPaused.exception): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an exception\nwhyPaused.exception=Paused on exception\n\n# LOCALIZATION NOTE (whyPaused.resumeLimit): The text that is displayed\n# in a info block explaining how the debugger is currently paused while stepping\n# in or out of the stack\nwhyPaused.resumeLimit=Paused while stepping\n\n# LOCALIZATION NOTE (whyPaused.pauseOnDOMEvents): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# dom event\nwhyPaused.pauseOnDOMEvents=Paused on event listener\n\n# LOCALIZATION NOTE (whyPaused.breakpointConditionThrown): The text that is displayed\n# in an info block when evaluating a conditional breakpoint throws an error\nwhyPaused.breakpointConditionThrown=Error with conditional breakpoint\n\n# LOCALIZATION NOTE (whyPaused.xhr): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# xml http request\nwhyPaused.xhr=Paused on XMLHttpRequest\n\n# LOCALIZATION NOTE (whyPaused.promiseRejection): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# promise rejection\nwhyPaused.promiseRejection=Paused on promise rejection\n\n# LOCALIZATION NOTE (whyPaused.assert): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an\n# assert\nwhyPaused.assert=Paused on assertion\n\n# LOCALIZATION NOTE (whyPaused.debugCommand): The text that is displayed\n# in a info block explaining how the debugger is currently paused on a\n# debugger statement\nwhyPaused.debugCommand=Paused on debugged function\n\n# LOCALIZATION NOTE (whyPaused.other): The text that is displayed\n# in a info block explaining how the debugger is currently paused on an event\n# listener breakpoint set\nwhyPaused.other=Debugger paused\n\n# LOCALIZATION NOTE (ctrl): The text that is used for documenting\n# keyboard shortcuts that use the control key\nctrl=Ctrl\n" /***/ }, /* 961 */, @@ -37962,156 +36986,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/* 966 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - /* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ - - var _require = __webpack_require__(830), - Menu = _require.Menu, - MenuItem = _require.MenuItem; - - var _require2 = __webpack_require__(828), - isFirefoxPanel = _require2.isFirefoxPanel; - - if (!isFirefoxPanel()) { - __webpack_require__(973); - } - - function createPopup(doc) { - var popup = doc.createElement("menupopup"); - popup.className = "landing-popup"; - if (popup.openPopupAtScreen) { - return popup; - } - - function preventDefault(e) { - e.preventDefault(); - e.returnValue = false; - } - - var mask = document.querySelector("#contextmenu-mask"); - if (!mask) { - mask = doc.createElement("div"); - mask.id = "contextmenu-mask"; - document.body.appendChild(mask); - } - - mask.onclick = () => popup.hidePopup(); - - popup.openPopupAtScreen = function (clientX, clientY) { - this.style.setProperty("left", `${clientX}px`); - this.style.setProperty("top", `${clientY}px`); - mask = document.querySelector("#contextmenu-mask"); - window.onwheel = preventDefault; - mask.classList.add("show"); - this.dispatchEvent(new Event("popupshown")); - this.popupshown; - }; - - popup.hidePopup = function () { - this.remove(); - mask = document.querySelector("#contextmenu-mask"); - mask.classList.remove("show"); - window.onwheel = null; - }; - - return popup; - } - - if (!isFirefoxPanel()) { - Menu.prototype.createPopup = createPopup; - } - - function onShown(menu, popup) { - popup.childNodes.forEach((menuItemNode, i) => { - var item = menu.items[i]; - - if (!item.disabled && item.visible) { - menuItemNode.onclick = () => { - item.click(); - popup.hidePopup(); - }; - - showSubMenu(item.submenu, menuItemNode, popup); - } - }); - } - - function showMenu(evt, items) { - if (items.length === 0) { - return; - } - - var menu = new Menu(); - items.filter(item => item.visible === undefined || item.visible === true).forEach(item => { - var menuItem = new MenuItem(item); - menuItem.submenu = createSubMenu(item.submenu); - menu.append(menuItem); - }); - - if (isFirefoxPanel()) { - menu.popup(evt.screenX, evt.screenY, { doc: window.parent.document }); - return; - } - - menu.on("open", (_, popup) => onShown(menu, popup)); - menu.popup(evt.clientX, evt.clientY, { doc: document }); - } - - function createSubMenu(subItems) { - if (subItems) { - var subMenu = new Menu(); - subItems.forEach(subItem => { - subMenu.append(new MenuItem(subItem)); - }); - return subMenu; - } - return null; - } - - function showSubMenu(subMenu, menuItemNode, popup) { - if (subMenu) { - var subMenuNode = menuItemNode.querySelector("menupopup"); - - var _popup$getBoundingCli = popup.getBoundingClientRect(), - left = _popup$getBoundingCli.left, - top = _popup$getBoundingCli.top, - width = _popup$getBoundingCli.width; - - subMenuNode.style.setProperty("left", `${left + width}px`); - subMenuNode.style.setProperty("top", `${top}px`); - - var subMenuItemNodes = menuItemNode.querySelector("menupopup:not(.landing-popup)").childNodes; - subMenuItemNodes.forEach((subMenuItemNode, j) => { - var subMenuItem = subMenu.items.filter(item => item.visible === undefined || item.visible === true)[j]; - if (!subMenuItem.disabled && subMenuItem.visible) { - subMenuItemNode.onclick = () => { - subMenuItem.click(); - popup.hidePopup(); - }; - } - }); - } - } - - function buildMenu(items) { - return items.map(itm => { - var hide = typeof itm.hidden === "function" ? itm.hidden() : itm.hidden; - return hide ? null : itm.item; - }).filter(itm => itm !== null); - } - - module.exports = { - showMenu, - buildMenu - }; - -/***/ }, +/* 966 */, /* 967 */ /***/ function(module, exports, __webpack_require__) { @@ -39016,12 +37891,7 @@ return /******/ (function(modules) { // webpackBootstrap exports.KeyShortcuts = KeyShortcuts; /***/ }, -/* 973 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ }, +/* 973 */, /* 974 */, /* 975 */ /***/ function(module, exports, __webpack_require__) { @@ -41550,6 +40420,37 @@ return /******/ (function(modules) { // webpackBootstrap return this._longString(aGrip, "_threadGrips"); }, + /** + * Get or create an ArrayBuffer client, checking the grip client cache if it + * already exists. + * + * @param aGrip Object + * The ArrayBuffer grip returned by the protocol. + * @param aGripCacheName String + * The property name of the grip client cache to check for existing + * clients in. + */ + _arrayBuffer: function (aGrip, aGripCacheName) { + if (aGrip.actor in this[aGripCacheName]) { + return this[aGripCacheName][aGrip.actor]; + } + + var client = new ArrayBufferClient(this.client, aGrip); + this[aGripCacheName][aGrip.actor] = client; + return client; + }, + + /** + * Return an instance of ArrayBufferClient for the given ArrayBuffer grip that + * is scoped to the thread lifetime. + * + * @param aGrip Object + * The ArrayBuffer grip returned by the protocol. + */ + threadArrayBuffer: function (aGrip) { + return this._arrayBuffer(aGrip, "_threadGrips"); + }, + /** * Clear and invalidate all the grip clients from the given cache. * @@ -42073,6 +40974,44 @@ return /******/ (function(modules) { // webpackBootstrap }, {}) }; + /** + * A ArrayBufferClient provides a way to access ArrayBuffer from the + * debugger server. + * + * @param aClient DebuggerClient + * The debugger client parent. + * @param aGrip Object + * A pause-lifetime ArrayBuffer grip returned by the protocol. + */ + function ArrayBufferClient(aClient, aGrip) { + this._grip = aGrip; + this._client = aClient; + this.request = this._client.request; + } + exports.ArrayBufferClient = ArrayBufferClient; + + ArrayBufferClient.prototype = { + get actor() { + return this._grip.actor; + }, + get length() { + return this._grip.length; + }, + get _transport() { + return this._client._transport; + }, + + valid: true, + + slice: DebuggerClient.requester({ + type: "slice", + start: args(0), + count: args(1) + }, { + telemetry: "SLICE" + }) + }; + /** * A LongStringClient provides a way to access "very long" strings from the * debugger server. @@ -42292,6 +41231,29 @@ return /******/ (function(modules) { // webpackBootstrap var contentType = aResponse.contentType, source = aResponse.source; + + if (source.type === 'arrayBuffer') { + var arrayBuffer = this._activeThread.threadArrayBuffer(source); + return arrayBuffer.slice(0, arrayBuffer.length).then(function (resp) { + if (resp.error) { + aCallback(resp); + return resp; + } + // Keeping str as a string, ArrayBuffer/Uint8Array will not survive + // immutable operations. + var str = atob(resp.encoded); + var newResponse = { + source: { + "binary": str, + toString: "[wasm]" + }, + contentType: contentType + }; + aCallback(newResponse); + return newResponse; + }); + } + var longString = this._activeThread.threadLongString(source); return longString.substring(0, longString.length).then(function (aResponse) { if (aResponse.error) { @@ -47623,103 +46585,7 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, /* 1010 */, -/* 1011 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react = __webpack_require__(2); - - var _devtoolsConfig = __webpack_require__(828); - - var _reactDom = __webpack_require__(31); - - var _reactDom2 = _interopRequireDefault(_reactDom); - - var _Svg = __webpack_require__(344); - - var _Svg2 = _interopRequireDefault(_Svg); - - var _classnames = __webpack_require__(175); - - var _classnames2 = _interopRequireDefault(_classnames); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var breakpointSvg = document.createElement("span"); - - _reactDom2.default.render((0, _Svg2.default)("column-breakpoint"), breakpointSvg); - - function makeBookmark(isDisabled) { - var bp = breakpointSvg.cloneNode(true); - bp.className = (0, _classnames2.default)("editor column-breakpoint", { - "breakpoint-disabled": isDisabled - }); - - return bp; - } - - class ColumnBreakpoint extends _react.Component { - - constructor() { - super(); - - this.bookmark = undefined; - var self = this; - self.addBreakpoint = this.addBreakpoint.bind(this); - } - - addBreakpoint() { - if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) { - return; - } - - var bp = this.props.breakpoint; - var line = bp.location.line - 1; - var column = bp.location.column; - var editor = this.props.editor; - - var widget = makeBookmark(bp.disabled); - var bookmark = editor.setBookmark({ line, ch: column }, { widget }); - this.bookmark = bookmark; - } - shouldComponentUpdate(nextProps) { - return this.props.editor !== nextProps.editor || this.props.breakpoint.disabled !== nextProps.breakpoint.disabled || this.props.breakpoint.condition !== nextProps.breakpoint.condition; - } - componentDidMount() { - if (!this.props.editor) { - return; - } - - this.addBreakpoint(); - } - componentDidUpdate() { - if (this.bookmark) { - this.bookmark.clear(); - } - this.addBreakpoint(); - } - componentWillUnmount() { - if (!this.props.editor || !this.bookmark) { - return; - } - - this.bookmark.clear(); - } - render() { - return null; - } - } - - ColumnBreakpoint.displayName = "ColumnBreakpoint"; - - exports.default = ColumnBreakpoint; - -/***/ }, +/* 1011 */, /* 1012 */ /***/ function(module, exports, __webpack_require__) { @@ -48131,6 +46997,14 @@ return /******/ (function(modules) { // webpackBootstrap return getFrameUrl(frame).match(/ember/i); } + function isRxJs(frame) { + return getFrameUrl(frame).match(/rxjs/i); + } + + function isAngular(frame) { + return getFrameUrl(frame).match(/angular/i); + } + function getLibraryFromUrl(frame) { // @TODO each of these fns calls getFrameUrl, just call it once // (assuming there's not more complex logic to identify a lib) @@ -48178,6 +47052,14 @@ return /******/ (function(modules) { // webpackBootstrap if (isEmber(frame)) { return "Ember"; } + + if (isRxJs(frame)) { + return "RxJS"; + } + + if (isAngular(frame)) { + return "Angular"; + } } var displayNameMap = { @@ -48538,9 +47420,10 @@ return /******/ (function(modules) { // webpackBootstrap var start = highlightedLineRange.start, end = highlightedLineRange.end; - - (0, _range2.default)(start - 1, end).forEach(line => { - codeMirror.removeLineClass(line, "line", "highlight-lines"); + codeMirror.operation(() => { + (0, _range2.default)(start - 1, end).forEach(line => { + codeMirror.removeLineClass(line, "line", "highlight-lines"); + }); }); } @@ -48565,10 +47448,12 @@ return /******/ (function(modules) { // webpackBootstrap end = highlightedLineRange.end; - editor.alignLine(start); + codeMirror.operation(() => { + editor.alignLine(start); - (0, _range2.default)(start - 1, end).forEach(line => { - codeMirror.addLineClass(line, "line", "highlight-lines"); + (0, _range2.default)(start - 1, end).forEach(line => { + codeMirror.addLineClass(line, "line", "highlight-lines"); + }); }); } @@ -48724,7 +47609,12 @@ return /******/ (function(modules) { // webpackBootstrap function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var BracketArrow = (orientation, left, top, bottom) => { + var BracketArrow = (_ref) => { + var orientation = _ref.orientation, + left = _ref.left, + top = _ref.top, + bottom = _ref.bottom; + return _react.DOM.div({ className: (0, _classnames2.default)("bracket-arrow", orientation || "up"), style: { left, top, bottom } @@ -49313,22 +48203,54 @@ return /******/ (function(modules) { // webpackBootstrap /* 1055 */, /* 1056 */, /* 1057 */ -/***/ function(module, exports) { +/***/ function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); + exports.getGeneratedLocation = undefined; - var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + var getGeneratedLocation = exports.getGeneratedLocation = (() => { + var _ref2 = _asyncToGenerator(function* (source, sourceMaps, location) { + if (!sourceMaps.isOriginalId(location.sourceId)) { + return location; + } + + return yield sourceMaps.getGeneratedLocation(location, source.toJS()); + }); + + return function getGeneratedLocation(_x2, _x3, _x4) { + return _ref2.apply(this, arguments); + }; + })(); exports.firstString = firstString; exports.locationMoved = locationMoved; exports.makeLocationId = makeLocationId; exports.makePendingLocationId = makePendingLocationId; - exports.allBreakpointsDisabled = allBreakpointsDisabled; - exports.equalizeLocationColumn = equalizeLocationColumn; + exports.assertBreakpoint = assertBreakpoint; + exports.assertPendingBreakpoint = assertPendingBreakpoint; + exports.assertLocation = assertLocation; + exports.assertPendingLocation = assertPendingLocation; + exports.breakpointAtLocation = breakpointAtLocation; + exports.breakpointExists = breakpointExists; + exports.createBreakpoint = createBreakpoint; + exports.createPendingBreakpoint = createPendingBreakpoint; + + var _devtoolsConfig = __webpack_require__(828); + + var _selectors = __webpack_require__(242); + + var _assert = __webpack_require__(223); + + var _assert2 = _interopRequireDefault(_assert); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + // Return the first argument that is a string, or null if nothing is a // string. function firstString() { @@ -49345,7 +48267,7 @@ return /******/ (function(modules) { // webpackBootstrap } function locationMoved(location, newLocation) { - return location.line !== newLocation.line || location.column != null && location.column !== newLocation.column; + return location.line !== newLocation.line || location.column !== newLocation.column; } function makeLocationId(location) { @@ -49358,25 +48280,109 @@ return /******/ (function(modules) { // webpackBootstrap } function makePendingLocationId(location) { + assertPendingLocation(location); var sourceUrl = location.sourceUrl, line = location.line, column = location.column; var sourceUrlString = sourceUrl || ""; var columnString = column || ""; + return `${sourceUrlString}:${line}:${columnString}`; } - function allBreakpointsDisabled(state) { - return state.breakpoints.every(x => x.disabled); + function assertBreakpoint(breakpoint) { + assertLocation(breakpoint.location); + assertLocation(breakpoint.generatedLocation); + } + + function assertPendingBreakpoint(pendingBreakpoint) { + assertPendingLocation(pendingBreakpoint.location); + assertPendingLocation(pendingBreakpoint.generatedLocation); + } + + function assertLocation(location) { + assertPendingLocation(location); + var sourceId = location.sourceId; + + (0, _assert2.default)(!!sourceId, "location must have a source id"); + } + + function assertPendingLocation(location) { + (0, _assert2.default)(!!location, "location must exist"); + + var sourceUrl = location.sourceUrl; + + // sourceUrl is null when the source does not have a url + + (0, _assert2.default)(sourceUrl !== undefined, "location must have a source url"); + (0, _assert2.default)(location.hasOwnProperty("line"), "location must have a line"); + (0, _assert2.default)(location.hasOwnProperty("column") != null, "location must have a column"); } // syncing - function equalizeLocationColumn(location, referenceLocation) { - if (referenceLocation.column) { - return location; - } - return _extends({}, location, { column: undefined }); + function breakpointAtLocation(breakpoints, _ref) { + var line = _ref.line, + column = _ref.column; + + return breakpoints.find(breakpoint => { + var sameLine = breakpoint.location.line === line + 1; + if (!sameLine) { + return false; + } + + // NOTE: when column breakpoints are disabled we want to find + // the first breakpoint + if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints")) { + return true; + } + + return breakpoint.location.column === column; + }); + } + + function breakpointExists(state, location) { + var currentBp = (0, _selectors.getBreakpoint)(state, location); + return currentBp && !currentBp.disabled; + } + + function createBreakpoint(location) { + var overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var condition = overrides.condition, + disabled = overrides.disabled, + generatedLocation = overrides.generatedLocation; + + var properties = { + condition: condition || null, + disabled: disabled || false, + generatedLocation: generatedLocation || location, + location + }; + + return properties; + } + + function createPendingLocation(location) { + var sourceUrl = location.sourceUrl, + line = location.line, + column = location.column; + + return { sourceUrl: sourceUrl, line, column }; + } + + function createPendingBreakpoint(bp) { + var pendingLocation = createPendingLocation(bp.location); + var pendingGeneratedLocation = createPendingLocation(bp.generatedLocation); + + assertPendingLocation(pendingLocation); + assertPendingLocation(pendingLocation); + + return { + condition: bp.condition, + disabled: bp.disabled, + location: pendingLocation, + generatedLocation: pendingGeneratedLocation + }; } /***/ }, @@ -49619,6 +48625,23 @@ return /******/ (function(modules) { // webpackBootstrap }; } + function findBestMatch(symbols, tokenPos, token) { + var memberExpressions = symbols.memberExpressions, + identifiers = symbols.identifiers; + var line = tokenPos.line, + column = tokenPos.column; + + return identifiers.concat(memberExpressions).reduce((found, expression) => { + var overlaps = expression.location.start.line == line && expression.location.start.column <= column && expression.location.end.column >= column; + + if (overlaps) { + return expression; + } + + return found; + }, {}); + } + function setSelection(token, tokenPos, cursorPos) { return (() => { var _ref6 = _asyncToGenerator(function* (_ref7) { @@ -49635,14 +48658,15 @@ return /******/ (function(modules) { // webpackBootstrap type: "SET_SELECTION", [_promise.PROMISE]: _asyncToGenerator(function* () { var source = (0, _selectors.getSelectedSource)(getState()); - var closestExpression = yield parser.getClosestExpression(source.toJS(), token, tokenPos); + var _symbols = yield parser.getSymbols(source.toJS()); - if (!closestExpression) { + var found = findBestMatch(_symbols, tokenPos, token); + if (!found) { return; } - var expression = closestExpression.expression, - location = closestExpression.location; + var expression = found.expression, + location = found.location; if (!expression) { @@ -49656,6 +48680,10 @@ return /******/ (function(modules) { // webpackBootstrap }), result = _ref9.result; + if (!result) { + return; + } + return { expression, result, @@ -49674,237 +48702,8 @@ return /******/ (function(modules) { // webpackBootstrap } /***/ }, -/* 1060 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - - var _react = __webpack_require__(2); - - var _reactRedux = __webpack_require__(151); - - var _redux = __webpack_require__(3); - - var _actions = __webpack_require__(244); - - var _actions2 = _interopRequireDefault(_actions); - - var _selectors = __webpack_require__(242); - - var _utils = __webpack_require__(234); - - var _url = __webpack_require__(334); - - var _source = __webpack_require__(233); - - var _devtoolsConfig = __webpack_require__(828); - - var _projectSearch = __webpack_require__(1061); - - __webpack_require__(1062); - - var _Autocomplete2 = __webpack_require__(342); - - var _Autocomplete3 = _interopRequireDefault(_Autocomplete2); - - var _TextSearch2 = __webpack_require__(1064); - - var _TextSearch3 = _interopRequireDefault(_TextSearch2); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - var Autocomplete = (0, _react.createFactory)(_Autocomplete3.default); - - var TextSearch = (0, _react.createFactory)(_TextSearch3.default); - - function getSourcePath(source) { - if (!source.url) { - return ""; - } - - var _parseURL = (0, _url.parse)(source.url), - path = _parseURL.path, - href = _parseURL.href; - // for URLs like "about:home" the path is null so we pass the full href - - - return path || href; - } - - function searchResults(sources, query) { - if ((0, _devtoolsConfig.isEnabled)("projectTextSearch")) { - return projectSearchResults(sources, query); - } - - return fileSearchResults(sources); - } - - function fileSearchResults(sourceMap) { - return sourceMap.valueSeq().toJS().filter(source => !(0, _source.isPretty)(source)).map(source => ({ - value: getSourcePath(source), - title: getSourcePath(source).split("/").pop(), - subtitle: (0, _utils.endTruncateStr)(getSourcePath(source), 100), - id: source.id - })); - } - - function projectSearchResults(sources, query) { - return sources.valueSeq().toJS().map(source => (0, _projectSearch.searchSource)(source, query).map(result => ({ - value: result.match, - title: result.text, - subtitle: (0, _utils.endTruncateStr)(getSourcePath(source), 100), - id: `${result.text}/${result.line}/${result.column}` - }))); - } - - class ProjectSearch extends _react.Component { - - constructor(props) { - super(props); - - this.state = { - inputValue: "" - }; - - this.toggleProjectSearch = this.toggleProjectSearch.bind(this); - this.onEscape = this.onEscape.bind(this); - this.close = this.close.bind(this); - } - - componentWillUnmount() { - var shortcuts = this.context.shortcuts; - var searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.key2")]; - searchKeys.forEach(key => shortcuts.off(key, this.toggleProjectSearch)); - shortcuts.off("Escape", this.onEscape); - } - - componentDidMount() { - var shortcuts = this.context.shortcuts; - var searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; - searchKeys.forEach(key => shortcuts.on(key, this.toggleProjectSearch)); - shortcuts.on("Escape", this.onEscape); - } - - toggleProjectSearch(key, e) { - e.preventDefault(); - this.props.toggleProjectSearch(); - } - - onEscape(shortcut, e) { - if (this.props.searchOn) { - e.preventDefault(); - this.close(); - } - } - - close() { - this.setState({ inputValue: "" }); - this.props.toggleProjectSearch(false); - } - - renderFileSearch() { - return Autocomplete({ - selectItem: (e, result) => { - this.props.selectSource(result.id); - this.close(); - }, - close: this.close, - items: searchResults(this.props.sources, this.state.inputValue), - inputValue: this.state.inputValue, - placeholder: L10N.getStr("sourceSearch.search"), - size: "big" - }); - } - - renderTextSearch() { - var sources = this.props.sources; - - - return TextSearch({ - sources - }); - } - - render() { - var searchOn = this.props.searchOn; - - if (!searchOn) { - return null; - } - - return _react.DOM.div({ className: "search-container" }, (0, _devtoolsConfig.isEnabled)("projectTextSearch") ? this.renderTextSearch() : this.renderFileSearch()); - } - } - - ProjectSearch.propTypes = { - sources: _react.PropTypes.object.isRequired, - selectSource: _react.PropTypes.func.isRequired, - toggleProjectSearch: _react.PropTypes.func.isRequired, - searchOn: _react.PropTypes.bool - }; - - ProjectSearch.contextTypes = { - shortcuts: _react.PropTypes.object - }; - - ProjectSearch.displayName = "ProjectSearch"; - - exports.default = (0, _reactRedux.connect)(state => ({ - sources: (0, _selectors.getSources)(state), - searchOn: (0, _selectors.getProjectSearchState)(state) - }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(ProjectSearch); - -/***/ }, -/* 1061 */ -/***/ function(module, exports) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.searchSource = searchSource; - - 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 searchSource(source, queryText) { - var _ref; - - var text = source.text, - loading = source.loading; - - if (loading || !text || queryText == "") { - return []; - } - - var lines = text.split("\n"); - var result = undefined; - var query = new RegExp(queryText, "g"); - - var matches = lines.map((_text, line) => { - var indices = []; - - while (result = query.exec(_text)) { - indices.push({ - line: line + 1, - column: result.index, - match: result[0], - value: _text, - text: result.input - }); - } - return indices; - }).filter(_matches => _matches.length > 0); - - matches = (_ref = []).concat.apply(_ref, _toConsumableArray(matches)); - return matches; - } - -/***/ }, +/* 1060 */, +/* 1061 */, /* 1062 */ /***/ function(module, exports) { @@ -49927,6 +48726,10 @@ return /******/ (function(modules) { // webpackBootstrap var _classnames2 = _interopRequireDefault(_classnames); + var _escapeRegExp = __webpack_require__(259); + + var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); + var _Svg = __webpack_require__(344); var _Svg2 = _interopRequireDefault(_Svg); @@ -49939,7 +48742,9 @@ return /******/ (function(modules) { // webpackBootstrap var _SearchInput3 = _interopRequireDefault(_SearchInput2); - var _projectSearch = __webpack_require__(1061); + var _projectSearch = __webpack_require__(1140); + + var _projectSearch2 = _interopRequireDefault(_projectSearch); __webpack_require__(1065); @@ -49951,34 +48756,36 @@ return /******/ (function(modules) { // webpackBootstrap var SearchInput = (0, _react.createFactory)(_SearchInput3.default); - function search(query, sources) { - var validSources = sources.valueSeq().filter(s => s.has("text")).toJS(); - return validSources.map(source => ({ - source, - filepath: source.url, - matches: (0, _projectSearch.searchSource)(source, query) - })); - } - class TextSearch extends _react.Component { constructor(props) { super(props); this.state = { results: [], - inputValue: props.inputValue || "", + inputValue: "", selectedIndex: 0, focused: false }; + + this.inputOnChange = this.inputOnChange.bind(this); + this.onKeyDown = this.onKeyDown.bind(this); + this.close = this.close.bind(this); } - inputOnChange(e) { + close() { + this.setState({ inputValue: "", results: [], selectedIndex: 0 }); + this.props.closeActiveSearch(); + } + + onKeyDown(e) { var _this = this; return _asyncToGenerator(function* () { + if (e.key !== "Enter") { + return; + } + var inputValue = _this.state.inputValue; var sources = _this.props.sources; - - var inputValue = e.target.value; - var results = yield search(inputValue, sources); + var results = yield (0, _projectSearch2.default)(inputValue, sources); _this.setState({ results, @@ -49988,28 +48795,70 @@ return /******/ (function(modules) { // webpackBootstrap })(); } - renderFile(file, expanded) { + inputOnChange(e) { + var inputValue = e.target.value; + this.setState({ inputValue }); + } + + renderFile(file, focused, expanded, setExpanded) { + if (file.matches.length === 0) { + return null; + } return _react.DOM.div({ - className: "file-result", - key: file.filepath + className: (0, _classnames2.default)("file-result", { focused }), + key: file.filepath, + onClick: e => setExpanded(file, !expanded) }, (0, _Svg2.default)("arrow", { className: (0, _classnames2.default)({ expanded }) - }), file.filepath); + }), _react.DOM.span({ className: "file-path" }, file.filepath), _react.DOM.span({ className: "matches-summary", key: `m-${file.filepath}` }, ` (${file.matches.length} match${file.matches.length > 1 ? "es" : ""})`)); } - renderMatch(match) { - return _react.DOM.div({ className: "result", key: `${match.line}/${match.column}` }, _react.DOM.span({ - className: "line-number" - }, match.line), _react.DOM.span({ className: "line-match" }, match.value)); + renderMatch(match, focused) { + return _react.DOM.div({ + className: (0, _classnames2.default)("result", { focused }), + key: `${match.line}/${match.column}`, + onClick: () => console.log(`clicked ${match}`) + }, _react.DOM.span({ + className: "line-number", + key: `${match.line}` + }, match.line), this.renderMatchValue(match.value)); + } + + renderMatchValue(value) { + var inputValue = this.state.inputValue; + + var match = void 0; + var len = inputValue.length; + var matchIndexes = []; + var matches = []; + var re = new RegExp((0, _escapeRegExp2.default)(inputValue), "g"); + while ((match = re.exec(value)) !== null) { + matchIndexes.push(match.index); + } + + matchIndexes.forEach((matchIndex, index) => { + if (matchIndex > 0 && index === 0) { + matches.push(_react.DOM.span({ className: "line-match" }, value.slice(0, matchIndex))); + } + if (matchIndex > matchIndexes[index - 1] + len) { + matches.push(_react.DOM.span({ className: "line-match" }, value.slice(matchIndexes[index - 1] + len, matchIndex))); + } + matches.push(_react.DOM.span({ className: "query-match", key: index }, value.substr(matchIndex, len))); + if (index === matchIndexes.length - 1) { + matches.push(_react.DOM.span({ + className: "line-match" + }, value.slice(matchIndex + len, value.length))); + } + }); + + return _react.DOM.span.apply(_react.DOM, [{ className: "line-value" }].concat(matches)); } renderResults() { - var results = this.state.results; - return ManagedTree({ - getRoots: () => results, + getRoots: () => this.state.results, getChildren: file => { return file.matches || []; }, @@ -50017,8 +48866,11 @@ return /******/ (function(modules) { // webpackBootstrap autoExpand: 1, autoExpandDepth: 1, getParent: item => null, - getKey: item => item.filepath || `${item.value}/${item.line}`, - renderItem: (item, depth, focused, _, expanded) => item.filepath ? this.renderFile(item, expanded) : this.renderMatch(item) + getKey: item => item.filepath || `${item.value}/${item.line}/${item.column}`, + renderItem: (item, depth, focused, _, expanded, _ref) => { + var setExpanded = _ref.setExpanded; + return item.filepath ? this.renderFile(item, focused, expanded, setExpanded) : this.renderMatch(item, focused); + } }); } @@ -50041,8 +48893,8 @@ return /******/ (function(modules) { // webpackBootstrap onChange: e => this.inputOnChange(e), onFocus: () => this.setState({ focused: true }), onBlur: () => this.setState({ focused: false }), - onKeyDown: this.onKeyDown, - handleClose: this.props.close + onKeyDown: e => this.onKeyDown(e), + handleClose: this.close }); } @@ -50054,6 +48906,13 @@ return /******/ (function(modules) { // webpackBootstrap } exports.default = TextSearch; + TextSearch.propTypes = { + addTab: _react.PropTypes.func, + sources: _react.PropTypes.object, + query: _react.PropTypes.string, + closeActiveSearch: _react.PropTypes.func + }; + TextSearch.displayName = "TextSearch"; /***/ }, @@ -50295,7 +49154,7 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.countMatches = exports.stopSearchWorker = exports.startSearchWorker = undefined; + exports.searchSources = exports.getMatches = exports.stopSearchWorker = exports.startSearchWorker = undefined; var _devtoolsUtils = __webpack_require__(900); @@ -50306,95 +49165,11 @@ return /******/ (function(modules) { // webpackBootstrap var startSearchWorker = exports.startSearchWorker = dispatcher.start.bind(dispatcher); var stopSearchWorker = exports.stopSearchWorker = dispatcher.stop.bind(dispatcher); - var countMatches = exports.countMatches = dispatcher.task("countMatches"); - -/***/ }, -/* 1116 */ -/***/ function(module, exports, __webpack_require__) { - - "use strict"; - - Object.defineProperty(exports, "__esModule", { - value: true - }); - exports.default = buildQuery; - - var _escapeRegExp = __webpack_require__(259); - - var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); - - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - - /** - * Ignore doing outline matches for less than 3 whitespaces - * - * @memberof utils/source-search - * @static - */ - function ignoreWhiteSpace(str) { - return (/^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str - ); - } - - - function wholeMatch(query, wholeWord) { - if (query == "" || !wholeWord) { - return query; - } - - return `\\b${query}\\b`; - } - - function buildFlags(caseSensitive, isGlobal) { - if (caseSensitive && isGlobal) { - return "g"; - } - - if (!caseSensitive && isGlobal) { - return "gi"; - } - - if (!caseSensitive && !isGlobal) { - return "i"; - } - - return; - } - - function buildQuery(originalQuery, modifiers, _ref) { - var _ref$isGlobal = _ref.isGlobal, - isGlobal = _ref$isGlobal === undefined ? false : _ref$isGlobal, - _ref$ignoreSpaces = _ref.ignoreSpaces, - ignoreSpaces = _ref$ignoreSpaces === undefined ? false : _ref$ignoreSpaces; - var caseSensitive = modifiers.caseSensitive, - regexMatch = modifiers.regexMatch, - wholeWord = modifiers.wholeWord; - - - if (originalQuery == "") { - return new RegExp(originalQuery); - } - - var query = originalQuery; - if (ignoreSpaces) { - query = ignoreWhiteSpace(query); - } - - if (!regexMatch) { - query = (0, _escapeRegExp2.default)(query); - } - - query = wholeMatch(query, wholeWord); - var flags = buildFlags(caseSensitive, isGlobal); - - if (flags) { - return new RegExp(query, flags); - } - - return new RegExp(query); - } + var getMatches = exports.getMatches = dispatcher.task("getMatches"); + var searchSources = exports.searchSources = dispatcher.task("searchSources"); /***/ }, +/* 1116 */, /* 1117 */ /***/ function(module, exports) { @@ -50500,7 +49275,9 @@ return /******/ (function(modules) { // webpackBootstrap }); exports.default = getInScopeLines; - var _selectors = __webpack_require__(242); + var _ast = __webpack_require__(1058); + + var _sources = __webpack_require__(232); var _range = __webpack_require__(1026); @@ -50531,8 +49308,8 @@ return /******/ (function(modules) { // webpackBootstrap } function getInScopeLines(state) { - var source = (0, _selectors.getSelectedSource)(state); - var outOfScopeLocations = (0, _selectors.getOutOfScopeLocations)(state); + var source = (0, _sources.getSelectedSource)(state); + var outOfScopeLocations = (0, _ast.getOutOfScopeLocations)(state); if (!source || !source.get("text")) { return; @@ -50721,6 +49498,3206 @@ return /******/ (function(modules) { // webpackBootstrap return el && el.getBoundingClientRect().width; } +/***/ }, +/* 1129 */, +/* 1130 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + var _require = __webpack_require__(830), + Menu = _require.Menu, + MenuItem = _require.MenuItem; + + function inToolbox() { + return window.parent.document.documentURI == "about:devtools-toolbox"; + } + + if (!inToolbox()) { + __webpack_require__(1131); + } + + function createPopup(doc) { + var popup = doc.createElement("menupopup"); + popup.className = "landing-popup"; + if (popup.openPopupAtScreen) { + return popup; + } + + function preventDefault(e) { + e.preventDefault(); + e.returnValue = false; + } + + var mask = document.querySelector("#contextmenu-mask"); + if (!mask) { + mask = doc.createElement("div"); + mask.id = "contextmenu-mask"; + document.body.appendChild(mask); + } + + mask.onclick = () => popup.hidePopup(); + + popup.openPopupAtScreen = function (clientX, clientY) { + this.style.setProperty("left", `${clientX}px`); + this.style.setProperty("top", `${clientY}px`); + mask = document.querySelector("#contextmenu-mask"); + window.onwheel = preventDefault; + mask.classList.add("show"); + this.dispatchEvent(new Event("popupshown")); + this.popupshown; + }; + + popup.hidePopup = function () { + this.remove(); + mask = document.querySelector("#contextmenu-mask"); + mask.classList.remove("show"); + window.onwheel = null; + }; + + return popup; + } + + if (!inToolbox()) { + Menu.prototype.createPopup = createPopup; + } + + function onShown(menu, popup) { + popup.childNodes.forEach((menuItemNode, i) => { + var item = menu.items[i]; + + if (!item.disabled && item.visible) { + menuItemNode.onclick = () => { + item.click(); + popup.hidePopup(); + }; + + showSubMenu(item.submenu, menuItemNode, popup); + } + }); + } + + function showMenu(evt, items) { + if (items.length === 0) { + return; + } + + var menu = new Menu(); + items.filter(item => item.visible === undefined || item.visible === true).forEach(item => { + var menuItem = new MenuItem(item); + menuItem.submenu = createSubMenu(item.submenu); + menu.append(menuItem); + }); + + if (inToolbox()) { + menu.popup(evt.screenX, evt.screenY, { doc: window.parent.document }); + return; + } + + menu.on("open", (_, popup) => onShown(menu, popup)); + menu.popup(evt.clientX, evt.clientY, { doc: document }); + } + + function createSubMenu(subItems) { + if (subItems) { + var subMenu = new Menu(); + subItems.forEach(subItem => { + subMenu.append(new MenuItem(subItem)); + }); + return subMenu; + } + return null; + } + + function showSubMenu(subMenu, menuItemNode, popup) { + if (subMenu) { + var subMenuNode = menuItemNode.querySelector("menupopup"); + + var _menuItemNode$getBoun = menuItemNode.getBoundingClientRect(), + top = _menuItemNode$getBoun.top; + + var _popup$getBoundingCli = popup.getBoundingClientRect(), + left = _popup$getBoundingCli.left, + width = _popup$getBoundingCli.width; + + subMenuNode.style.setProperty("left", `${left + width}px`); + subMenuNode.style.setProperty("top", `${top}px`); + + var subMenuItemNodes = menuItemNode.querySelector("menupopup:not(.landing-popup)").childNodes; + subMenuItemNodes.forEach((subMenuItemNode, j) => { + var subMenuItem = subMenu.items.filter(item => item.visible === undefined || item.visible === true)[j]; + if (!subMenuItem.disabled && subMenuItem.visible) { + subMenuItemNode.onclick = () => { + subMenuItem.click(); + popup.hidePopup(); + }; + } + }); + } + } + + function buildMenu(items) { + return items.map(itm => { + var hide = typeof itm.hidden === "function" ? itm.hidden() : itm.hidden; + return hide ? null : itm.item; + }).filter(itm => itm !== null); + } + + module.exports = { + showMenu, + buildMenu + }; + +/***/ }, +/* 1131 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }, +/* 1132 */, +/* 1133 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.initialState = initialState; + exports.getPendingBreakpoints = getPendingBreakpoints; + + var _immutable = __webpack_require__(146); + + var I = _interopRequireWildcard(_immutable); + + var _makeRecord = __webpack_require__(230); + + var _makeRecord2 = _interopRequireDefault(_makeRecord); + + var _breakpoint = __webpack_require__(1057); + + var _prefs = __webpack_require__(226); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } } + + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + /** + * Breakpoints reducer + * @module reducers/breakpoints + */ + + function initialState() { + return (0, _makeRecord2.default)({ + pendingBreakpoints: restorePendingBreakpoints() + })(); + } + + function update() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initialState(); + var action = arguments[1]; + + switch (action.type) { + case "ADD_BREAKPOINT": + { + return addBreakpoint(state, action); + } + + case "SYNC_BREAKPOINT": + { + return addBreakpoint(state, action); + } + + case "ENABLE_BREAKPOINT": + { + return addBreakpoint(state, action); + } + + case "DISABLE_BREAKPOINT": + { + return updateBreakpoint(state, action); + } + + case "SET_BREAKPOINT_CONDITION": + { + return updateBreakpoint(state, action); + } + + case "REMOVE_BREAKPOINT": + { + return removeBreakpoint(state, action); + } + } + + return state; + } + + function addBreakpoint(state, action) { + if (action.status !== "done") { + return state; + } + + // when the action completes, we can commit the breakpoint + var breakpoint = action.value.breakpoint; + + var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); + var pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); + + return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); + } + + function updateBreakpoint(state, action) { + var breakpoint = action.breakpoint; + + var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); + var pendingBreakpoint = (0, _breakpoint.createPendingBreakpoint)(breakpoint); + + return state.setIn(["pendingBreakpoints", locationId], pendingBreakpoint); + } + + function removeBreakpoint(state, action) { + var breakpoint = action.breakpoint; + + var locationId = (0, _breakpoint.makePendingLocationId)(breakpoint.location); + + return state.deleteIn(["pendingBreakpoints", locationId]); + } + + // Selectors + // TODO: these functions should be moved out of the reducer + + function getPendingBreakpoints(state) { + return state.pendingBreakpoints.pendingBreakpoints; + } + + function restorePendingBreakpoints() { + return I.Map(_prefs.prefs.pendingBreakpoints); + } + + exports.default = update; + +/***/ }, +/* 1134 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = getBreakpointAtLocation; + + var _sources = __webpack_require__(232); + + var _breakpoints = __webpack_require__(236); + + var _devtoolsSourceMap = __webpack_require__(898); + + function isGenerated(selectedSource) { + var sourceId = selectedSource.get("id"); + return (0, _devtoolsSourceMap.isGeneratedId)(sourceId); + } + + function getColumn(column, selectedSource) { + if (column) { + return column; + } + + return isGenerated(selectedSource) ? undefined : 0; + } + + function getLocation(bp, selectedSource) { + return isGenerated(selectedSource) ? bp.generatedLocation || bp.location : bp.location; + } + + function getBreakpointsForSource(state, selectedSource) { + var breakpoints = (0, _breakpoints.getBreakpoints)(state); + + return breakpoints.filter(bp => { + var location = getLocation(bp, selectedSource); + return location.sourceId === selectedSource.get("id"); + }); + } + + function findBreakpointAtLocation(breakpoints, selectedSource, _ref) { + var line = _ref.line, + column = _ref.column; + + return breakpoints.find(breakpoint => { + var location = getLocation(breakpoint, selectedSource); + var sameLine = location.line === line; + if (!sameLine) { + return false; + } + + if (column === undefined) { + return true; + } + + return location.column === getColumn(column, selectedSource); + }); + } + + /* + * Finds a breakpoint at a location (line, column) of the + * selected source. + * + * This is useful for finding a breakpoint when the + * user clicks in the gutter or on a token. + */ + function getBreakpointAtLocation(state, location) { + var selectedSource = (0, _sources.getSelectedSource)(state); + var breakpoints = getBreakpointsForSource(state, selectedSource); + + return findBreakpointAtLocation(breakpoints, selectedSource, location); + } + +/***/ }, +/* 1135 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = getVisibleBreakpoints; + + var _breakpoints = __webpack_require__(236); + + var _sources = __webpack_require__(232); + + var _devtoolsSourceMap = __webpack_require__(898); + + function getLocation(breakpoint, isGeneratedSource) { + return isGeneratedSource ? breakpoint.generatedLocation || breakpoint.location : breakpoint.location; + } + + function formatBreakpoint(breakpoint, selectedSource) { + var condition = breakpoint.condition, + loading = breakpoint.loading, + disabled = breakpoint.disabled; + + var sourceId = selectedSource.get("id"); + var isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); + + return { + location: getLocation(breakpoint, isGeneratedSource), + condition, + loading, + disabled + }; + } + + function isVisible(breakpoint, selectedSource) { + var sourceId = selectedSource.get("id"); + var isGeneratedSource = (0, _devtoolsSourceMap.isGeneratedId)(sourceId); + + var location = getLocation(breakpoint, isGeneratedSource); + return location.sourceId === sourceId; + } + /* + * Finds the breakpoints, which appear in the selected source. + * + * This + */ + function getVisibleBreakpoints(state) { + var selectedSource = (0, _sources.getSelectedSource)(state); + if (!selectedSource) { + return null; + } + + return (0, _breakpoints.getBreakpoints)(state).filter(bp => isVisible(bp, selectedSource)).map(bp => formatBreakpoint(bp, selectedSource)); + } + +/***/ }, +/* 1136 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _getGeneratedLocation = (() => { + var _ref = _asyncToGenerator(function* (state, source, sourceMaps, location) { + var generatedLocation = yield (0, _breakpoint.getGeneratedLocation)(source, sourceMaps, location); + + var generatedSource = (0, _selectors.getSource)(state, generatedLocation.sourceId); + var sourceUrl = generatedSource.get("url"); + return _extends({}, generatedLocation, { sourceUrl }); + }); + + return function _getGeneratedLocation(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; + })(); + + var _breakpoint = __webpack_require__(1057); + + var _selectors = __webpack_require__(242); + + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + + exports.default = (() => { + var _ref2 = _asyncToGenerator(function* (getState, client, sourceMaps, _ref3) { + var breakpoint = _ref3.breakpoint; + + var state = getState(); + + var source = (0, _selectors.getSource)(state, breakpoint.location.sourceId); + var location = _extends({}, breakpoint.location, { sourceUrl: source.get("url") }); + var generatedLocation = yield _getGeneratedLocation(state, source, sourceMaps, location); + + (0, _breakpoint.assertLocation)(location); + (0, _breakpoint.assertLocation)(generatedLocation); + + if ((0, _breakpoint.breakpointExists)(state, location)) { + var _newBreakpoint = _extends({}, breakpoint, { location, generatedLocation }); + (0, _breakpoint.assertBreakpoint)(_newBreakpoint); + return { breakpoint: _newBreakpoint }; + } + + var _ref4 = yield client.setBreakpoint(generatedLocation, breakpoint.condition, sourceMaps.isOriginalId(location.sourceId)), + id = _ref4.id, + hitCount = _ref4.hitCount, + actualLocation = _ref4.actualLocation; + + var newGeneratedLocation = actualLocation || generatedLocation; + var newLocation = yield sourceMaps.getOriginalLocation(newGeneratedLocation); + + var newBreakpoint = { + id, + disabled: false, + loading: false, + condition: breakpoint.condition, + location: newLocation, + hitCount, + generatedLocation: newGeneratedLocation + }; + + (0, _breakpoint.assertBreakpoint)(newBreakpoint); + + var previousLocation = (0, _breakpoint.locationMoved)(location, newLocation) ? location : null; + + return { + breakpoint: newBreakpoint, + previousLocation + }; + }); + + function addBreakpoint(_x5, _x6, _x7, _x8) { + return _ref2.apply(this, arguments); + } + + return addBreakpoint; + })(); + +/***/ }, +/* 1137 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.syncClientBreakpoint = undefined; + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + // we have three forms of syncing: disabled syncing, existing server syncing + // and adding a new breakpoint + var syncClientBreakpoint = exports.syncClientBreakpoint = (() => { + var _ref = _asyncToGenerator(function* (sourceId, client, sourceMaps, pendingBreakpoint) { + var generatedSourceId = sourceMaps.isOriginalId(sourceId) ? (0, _devtoolsSourceMap.originalToGeneratedId)(sourceId) : sourceId; + + // this is the generatedLocation of the pending breakpoint, with + // the source id updated to reflect the new connection + var generatedLocation = _extends({}, pendingBreakpoint.generatedLocation, { + sourceId: generatedSourceId + }); + + var location = _extends({}, pendingBreakpoint.location, { + sourceId: generatedSourceId + }); + + (0, _breakpoint3.assertPendingBreakpoint)(pendingBreakpoint); + + /** ******* CASE 1: Disabled ***********/ + // early return if breakpoint is disabled, send overrides to update + // the id as expected + if (pendingBreakpoint.disabled) { + var _newLocation = yield sourceMaps.getOriginalLocation(generatedLocation); + + var _breakpoint = _extends({}, pendingBreakpoint, { + id: (0, _breakpoint3.makeLocationId)(_newLocation), + generatedLocation, + location: _newLocation + }); + + var previousLocation = (0, _breakpoint3.locationMoved)(location, _newLocation) ? location : null; + + (0, _breakpoint3.assertBreakpoint)(_breakpoint); + return { breakpoint: _breakpoint, previousLocation }; + } + + /** ******* CASE 2: Merge Server Breakpoint ***********/ + // early return if breakpoint exists on the server, send overrides + // to update the id as expected + var existingClient = client.getBreakpointByLocation(generatedLocation); + + if (existingClient) { + var _newGeneratedLocation = existingClient.actualLocation; + var _newLocation2 = yield sourceMaps.getOriginalLocation(_newGeneratedLocation); + + var _breakpoint2 = _extends({}, pendingBreakpoint, { + id: (0, _breakpoint3.makeLocationId)(_newLocation2), + generatedLocation: _newGeneratedLocation, + location: _newLocation2 + }); + + (0, _breakpoint3.assertBreakpoint)(_breakpoint2); + return { breakpoint: _breakpoint2, previousLocation: location }; + } + + /** ******* CASE 3: Add New Breakpoint ***********/ + // If we are not disabled, set the breakpoint on the server and get + // that info so we can set it on our breakpoints. + var clientBreakpoint = yield client.setBreakpoint(generatedLocation, pendingBreakpoint.condition, sourceMaps.isOriginalId(sourceId)); + + var newGeneratedLocation = clientBreakpoint.actualLocation; + var newLocation = yield sourceMaps.getOriginalLocation(newGeneratedLocation); + + var breakpoint = _extends({}, pendingBreakpoint, { + id: (0, _breakpoint3.makeLocationId)(newGeneratedLocation), + generatedLocation: newGeneratedLocation, + location: newLocation + }); + + (0, _breakpoint3.assertBreakpoint)(breakpoint); + return { breakpoint, previousLocation: location }; + }); + + return function syncClientBreakpoint(_x, _x2, _x3, _x4) { + return _ref.apply(this, arguments); + }; + })(); + + var _breakpoint3 = __webpack_require__(1057); + + var _devtoolsSourceMap = __webpack_require__(898); + + function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; } + +/***/ }, +/* 1138 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.default = buildQuery; + + var _escapeRegExp = __webpack_require__(259); + + var _escapeRegExp2 = _interopRequireDefault(_escapeRegExp); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + /** + * Ignore doing outline matches for less than 3 whitespaces + * + * @memberof utils/source-search + * @static + */ + function ignoreWhiteSpace(str) { + return (/^\s{0,2}$/.test(str) ? "(?!\\s*.*)" : str + ); + } + + + function wholeMatch(query, wholeWord) { + if (query == "" || !wholeWord) { + return query; + } + + return `\\b${query}\\b`; + } + + function buildFlags(caseSensitive, isGlobal) { + if (caseSensitive && isGlobal) { + return "g"; + } + + if (!caseSensitive && isGlobal) { + return "gi"; + } + + if (!caseSensitive && !isGlobal) { + return "i"; + } + + return; + } + + function buildQuery(originalQuery, modifiers, _ref) { + var _ref$isGlobal = _ref.isGlobal, + isGlobal = _ref$isGlobal === undefined ? false : _ref$isGlobal, + _ref$ignoreSpaces = _ref.ignoreSpaces, + ignoreSpaces = _ref$ignoreSpaces === undefined ? false : _ref$ignoreSpaces; + var caseSensitive = modifiers.caseSensitive, + regexMatch = modifiers.regexMatch, + wholeWord = modifiers.wholeWord; + + + if (originalQuery == "") { + return new RegExp(originalQuery); + } + + var query = originalQuery; + if (ignoreSpaces) { + query = ignoreWhiteSpace(query); + } + + if (!regexMatch) { + query = (0, _escapeRegExp2.default)(query); + } + + query = wholeMatch(query, wholeWord); + var flags = buildFlags(caseSensitive, isGlobal); + + if (flags) { + return new RegExp(query, flags); + } + + return new RegExp(query); + } + +/***/ }, +/* 1139 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _react = __webpack_require__(2); + + var _reactRedux = __webpack_require__(151); + + var _redux = __webpack_require__(3); + + var _actions = __webpack_require__(244); + + var _actions2 = _interopRequireDefault(_actions); + + var _devtoolsConfig = __webpack_require__(828); + + var _selectors = __webpack_require__(242); + + __webpack_require__(1062); + + var _TextSearch2 = __webpack_require__(1064); + + var _TextSearch3 = _interopRequireDefault(_TextSearch2); + + var _SourceSearch2 = __webpack_require__(1141); + + var _SourceSearch3 = _interopRequireDefault(_SourceSearch2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var TextSearch = (0, _react.createFactory)(_TextSearch3.default); + + var SourceSearch = (0, _react.createFactory)(_SourceSearch3.default); + + class ProjectSearch extends _react.Component { + + constructor(props) { + super(props); + + this.toggleSourceSearch = this.toggleSourceSearch.bind(this); + this.toggleProjectTextSearch = this.toggleProjectTextSearch.bind(this); + } + + componentDidMount() { + var shortcuts = this.context.shortcuts; + + shortcuts.on(L10N.getStr("projectTextSearch.key"), this.toggleProjectTextSearch); + + var searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; + searchKeys.forEach(key => shortcuts.on(key, this.toggleSourceSearch)); + } + + componentWillUnmount() { + var shortcuts = this.context.shortcuts; + shortcuts.off(L10N.getStr("projectTextSearch.key"), this.toggleProjectTextSearch); + + var searchKeys = [L10N.getStr("sources.search.key2"), L10N.getStr("sources.search.alt.key")]; + searchKeys.forEach(key => shortcuts.off(key, this.toggleSourceSearch)); + shortcuts.off("Escape", this.onEscape); + } + + toggleProjectTextSearch(key, e) { + var _props = this.props, + closeActiveSearch = _props.closeActiveSearch, + addTab = _props.addTab, + closeTab = _props.closeTab, + setActiveSearch = _props.setActiveSearch; + + e.preventDefault(); + + if (!(0, _devtoolsConfig.isEnabled)("projectTextSearch")) { + return; + } + + if (this.isProjectSearchEnabled()) { + closeTab(); + return closeActiveSearch(); + } + + addTab({ + id: "project", + isBlackBoxed: false, + isPrettyPrinted: false, + sourceMapURL: null, + url: "project" + }, 0); + + return setActiveSearch("project"); + } + + toggleSourceSearch(key, e) { + var _props2 = this.props, + closeActiveSearch = _props2.closeActiveSearch, + addTab = _props2.addTab, + closeTab = _props2.closeTab, + setActiveSearch = _props2.setActiveSearch; + + e.preventDefault(); + + if (this.isSourceSearchEnabled()) { + closeTab(); + return closeActiveSearch(); + } + + addTab({ + id: "source", + isBlackBoxed: false, + isPrettyPrinted: false, + sourceMapURL: null, + url: "source" + }, 0); + return setActiveSearch("source"); + } + + isProjectSearchEnabled() { + return this.props.activeSearch === "project"; + } + + isSourceSearchEnabled() { + return this.props.activeSearch === "source"; + } + + renderSourceSearch() { + var _props3 = this.props, + sources = _props3.sources, + selectSource = _props3.selectSource, + closeActiveSearch = _props3.closeActiveSearch; + + return SourceSearch({ sources, selectSource, closeActiveSearch }); + } + + renderTextSearch() { + var _props4 = this.props, + sources = _props4.sources, + closeActiveSearch = _props4.closeActiveSearch; + + return TextSearch({ sources, closeActiveSearch }); + } + + render() { + if (!(this.isProjectSearchEnabled() || this.isSourceSearchEnabled())) { + return null; + } + + return _react.DOM.div({ className: "search-container" }, this.isProjectSearchEnabled() ? this.renderTextSearch() : this.renderSourceSearch()); + } + } + + ProjectSearch.propTypes = { + sources: _react.PropTypes.object.isRequired, + setActiveSearch: _react.PropTypes.func.isRequired, + closeActiveSearch: _react.PropTypes.func.isRequired, + activeSearch: _react.PropTypes.string, + selectSource: _react.PropTypes.func.isRequired, + addTab: _react.PropTypes.func, + closeTab: _react.PropTypes.func + }; + + ProjectSearch.contextTypes = { + shortcuts: _react.PropTypes.object + }; + + ProjectSearch.displayName = "ProjectSearch"; + + exports.default = (0, _reactRedux.connect)(state => ({ + sources: (0, _selectors.getSources)(state), + activeSearch: (0, _selectors.getActiveSearchState)(state) + }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(ProjectSearch); + +/***/ }, +/* 1140 */ +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.searchSource = searchSource; + exports.default = searchSources; + + 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); } } + + // Maybe reuse file search's functions? + function searchSource(source, queryText) { + var _ref; + + var text = source.text, + loading = source.loading; + + if (loading || !text || queryText == "") { + return []; + } + + var lines = text.split("\n"); + var result = undefined; + var query = new RegExp(queryText, "g"); + + var matches = lines.map((_text, line) => { + var indices = []; + + while (result = query.exec(_text)) { + indices.push({ + line: line + 1, + column: result.index, + match: result[0], + value: _text, + text: result.input + }); + } + return indices; + }).filter(_matches => _matches.length > 0); + + matches = (_ref = []).concat.apply(_ref, _toConsumableArray(matches)); + return matches; + } + + function searchSources(query, sources) { + var validSources = sources.valueSeq().filter(s => s.has("text")).toJS(); + return validSources.map(source => ({ + source, + filepath: source.url, + matches: searchSource(source, query) + })); + } + +/***/ }, +/* 1141 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _react = __webpack_require__(2); + + var _source = __webpack_require__(233); + + var _utils = __webpack_require__(234); + + var _Autocomplete2 = __webpack_require__(342); + + var _Autocomplete3 = _interopRequireDefault(_Autocomplete2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var Autocomplete = (0, _react.createFactory)(_Autocomplete3.default); + + class SourceSearch extends _react.Component { + + constructor(props) { + super(props); + + this.close = this.close.bind(this); + + this.state = { + inputValue: "" + }; + } + + componentWillUnmount() { + var shortcuts = this.context.shortcuts; + shortcuts.off("Escape", this.onEscape); + } + + componentDidMount() { + var shortcuts = this.context.shortcuts; + shortcuts.on("Escape", this.onEscape); + } + + onEscape(shortcut, e) { + if (this.isProjectSearchEnabled()) { + e.preventDefault(); + this.close(); + } + } + + searchResults(sourceMap) { + return sourceMap.valueSeq().toJS().filter(source => !(0, _source.isPretty)(source)).map(source => ({ + value: (0, _source.getSourcePath)(source), + title: (0, _source.getSourcePath)(source).split("/").pop(), + subtitle: (0, _utils.endTruncateStr)((0, _source.getSourcePath)(source), 100), + id: source.id + })); + } + + close() { + this.setState({ inputValue: "" }); + this.props.closeActiveSearch(); + } + + render() { + var sources = this.props.sources; + + return Autocomplete({ + selectItem: (e, result) => { + this.props.selectSource(result.id); + this.close(); + }, + close: this.close, + items: this.searchResults(sources), + inputValue: this.state.inputValue, + placeholder: L10N.getStr("sourceSearch.search"), + size: "big" + }); + } + } + + exports.default = SourceSearch; + SourceSearch.contextTypes = { + shortcuts: _react.PropTypes.object + }; + + SourceSearch.displayName = "SourceSearch"; + +/***/ }, +/* 1142 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _react = __webpack_require__(2); + + var _redux = __webpack_require__(3); + + var _reactRedux = __webpack_require__(151); + + var _text = __webpack_require__(389); + + var _actions = __webpack_require__(244); + + var _actions2 = _interopRequireDefault(_actions); + + var _selectors = __webpack_require__(242); + + var _devtoolsConfig = __webpack_require__(828); + + __webpack_require__(1143); + + var _classnames = __webpack_require__(175); + + var _classnames2 = _interopRequireDefault(_classnames); + + var _Outline2 = __webpack_require__(1145); + + var _Outline3 = _interopRequireDefault(_Outline2); + + var _SourcesTree2 = __webpack_require__(1148); + + var _SourcesTree3 = _interopRequireDefault(_SourcesTree2); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var Outline = (0, _react.createFactory)(_Outline3.default); + + var SourcesTree = (0, _react.createFactory)(_SourcesTree3.default); + + class PrimaryPanes extends _react.Component { + + constructor(props) { + super(props); + this.state = { selectedPane: "sources" }; + + this.renderShortcut = this.renderShortcut.bind(this); + this.showPane = this.showPane.bind(this); + this.renderFooter = this.renderFooter.bind(this); + } + + showPane(selectedPane) { + this.setState({ selectedPane }); + } + + renderOutlineTabs() { + if (!(0, _devtoolsConfig.isEnabled)("outline")) { + return; + } + + return [_react.DOM.div({ + className: (0, _classnames2.default)("tab", { + active: this.state.selectedPane === "sources" + }), + onClick: () => this.showPane("sources"), + key: "sources-tab" + }, "Sources View"), _react.DOM.div({ + className: (0, _classnames2.default)("tab", { + active: this.state.selectedPane === "outline" + }), + onClick: () => this.showPane("outline"), + key: "outline-tab" + }, "Outline View")]; + } + + renderFooter() { + return _react.DOM.div({ + className: "source-footer" + }, this.renderOutlineTabs()); + } + + renderShortcut() { + if (this.props.horizontal) { + return _react.DOM.span({ + className: "sources-header-info", + dir: "ltr", + onClick: () => { + if (this.props.sourceSearchOn) { + return this.props.closeActiveSearch(); + } + this.props.setActiveSearch("source"); + } + }, L10N.getFormatStr("sources.search", (0, _text.formatKeyShortcut)(L10N.getStr("sources.search.key2")))); + } + } + + renderHeader() { + return _react.DOM.div({ className: "sources-header" }, this.renderShortcut()); + } + + render() { + var selectedPane = this.state.selectedPane; + var _props = this.props, + sources = _props.sources, + selectSource = _props.selectSource; + + + return _react.DOM.div({ className: "sources-panel" }, this.renderHeader(), SourcesTree({ + sources, + selectSource, + isHidden: selectedPane === "outline" + }), Outline({ selectSource, isHidden: selectedPane === "sources" }), this.renderFooter()); + } + } + + PrimaryPanes.displayName = "PrimaryPanes"; + + exports.default = (0, _reactRedux.connect)(state => ({ + sources: (0, _selectors.getSources)(state), + sourceSearchOn: (0, _selectors.getActiveSearchState)(state) === "source" + }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(PrimaryPanes); + +/***/ }, +/* 1143 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }, +/* 1144 */, +/* 1145 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _react = __webpack_require__(2); + + var _redux = __webpack_require__(3); + + var _reactRedux = __webpack_require__(151); + + var _classnames = __webpack_require__(175); + + var _classnames2 = _interopRequireDefault(_classnames); + + var _actions = __webpack_require__(244); + + var _actions2 = _interopRequireDefault(_actions); + + var _selectors = __webpack_require__(242); + + var _devtoolsConfig = __webpack_require__(828); + + __webpack_require__(1146); + + var _previewFunction = __webpack_require__(701); + + var _previewFunction2 = _interopRequireDefault(_previewFunction); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + class Outline extends _react.Component { + + constructor(props) { + super(props); + this.state = {}; + } + + selectItem(location) { + var _props = this.props, + selectedSource = _props.selectedSource, + selectSource = _props.selectSource; + + if (!selectedSource) { + return; + } + var selectedSourceId = selectedSource.get("id"); + var startLine = location.start.line; + selectSource(selectedSourceId, { line: startLine }); + } + + renderFunction(func) { + var name = func.name, + location = func.location; + + + return _react.DOM.li({ + key: `${name}:${location.start.line}:${location.start.column}`, + className: "outline-list__element", + onClick: () => this.selectItem(location) + }, (0, _previewFunction2.default)({ name })); + } + + renderFunctions() { + var symbols = this.props.symbols; + + + return symbols.functions.filter(func => func.name != "anonymous").map(func => this.renderFunction(func)); + } + + render() { + var isHidden = this.props.isHidden; + + if (!(0, _devtoolsConfig.isEnabled)("outline")) { + return null; + } + + return _react.DOM.div({ className: (0, _classnames2.default)("outline", { hidden: isHidden }) }, _react.DOM.ul({ className: "outline-list" }, this.renderFunctions())); + } + } + + Outline.displayName = "Outline"; + + exports.default = (0, _reactRedux.connect)(state => { + var selectedSource = (0, _selectors.getSelectedSource)(state); + return { + symbols: (0, _selectors.getSymbols)(state, selectedSource && selectedSource.toJS()), + selectedSource + }; + }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Outline); + +/***/ }, +/* 1146 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }, +/* 1147 */, +/* 1148 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _redux = __webpack_require__(3); + + var _reactRedux = __webpack_require__(151); + + var _react = __webpack_require__(2); + + var _classnames = __webpack_require__(175); + + var _classnames2 = _interopRequireDefault(_classnames); + + var _reactImmutableProptypes = __webpack_require__(150); + + var _reactImmutableProptypes2 = _interopRequireDefault(_reactImmutableProptypes); + + var _immutable = __webpack_require__(146); + + var _selectors = __webpack_require__(242); + + var _sourcesTree = __webpack_require__(391); + + var _ManagedTree2 = __webpack_require__(419); + + var _ManagedTree3 = _interopRequireDefault(_ManagedTree2); + + var _actions = __webpack_require__(244); + + var _actions2 = _interopRequireDefault(_actions); + + var _Svg = __webpack_require__(344); + + var _Svg2 = _interopRequireDefault(_Svg); + + var _devtoolsLaunchpad = __webpack_require__(131); + + var _clipboard = __webpack_require__(423); + + var _utils = __webpack_require__(234); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var ManagedTree = (0, _react.createFactory)(_ManagedTree3.default); + + class SourcesTree extends _react.Component { + + constructor(props) { + super(props); + this.state = (0, _sourcesTree.createTree)(this.props.sources, this.props.debuggeeUrl); + + this.focusItem = this.focusItem.bind(this); + this.selectItem = this.selectItem.bind(this); + this.getIcon = this.getIcon.bind(this); + this.onContextMenu = this.onContextMenu.bind(this); + this.renderItem = this.renderItem.bind(this); + + this.queueUpdate = (0, _utils.throttle)(function () { + if (!this.mounted) { + return; + } + + this.forceUpdate(); + }, 50); + } + + componentDidMount() { + this.mounted = true; + } + + componentWillUnMount() { + this.mounted = false; + } + + shouldComponentUpdate() { + this.queueUpdate(); + return false; + } + + componentWillReceiveProps(nextProps) { + if (this.props.debuggeeUrl != nextProps.debuggeeUrl) { + // Recreate tree because the sort order changed + this.setState((0, _sourcesTree.createTree)(this.props.sources, nextProps.debuggeeUrl)); + return; + } + var selectedSource = this.props.selectedSource; + + if (nextProps.shownSource && nextProps.shownSource != this.props.shownSource) { + var _listItems = (0, _sourcesTree.getDirectories)(nextProps.shownSource, this.state.sourceTree); + + if (_listItems && _listItems[0]) { + this.selectItem(_listItems[0]); + } + + return this.setState({ listItems: _listItems }); + } + + if (nextProps.selectedSource && nextProps.selectedSource != selectedSource) { + var _highlightItems = (0, _sourcesTree.getDirectories)(nextProps.selectedSource.get("url"), this.state.sourceTree); + + return this.setState({ highlightItems: _highlightItems }); + } + + if (nextProps.sources === this.props.sources) { + return; + } + + if (nextProps.sources.size === 0) { + // remove all sources + this.setState((0, _sourcesTree.createTree)(nextProps.sources, this.props.debuggeeUrl)); + return; + } + + // TODO: do not run this every time a source is clicked, + // only when a new source is added + var next = (0, _immutable.Set)(nextProps.sources.valueSeq()); + var prev = (0, _immutable.Set)(this.props.sources.valueSeq()); + var newSet = next.subtract(prev); + + var uncollapsedTree = this.state.uncollapsedTree; + for (var source of newSet) { + (0, _sourcesTree.addToTree)(uncollapsedTree, source, this.props.debuggeeUrl); + } + + // TODO: recreating the tree every time messes with the expanded + // state of ManagedTree, because it depends on item instances + // being the same. The result is that if a source is added at a + // later time, all expanded state is lost. + var sourceTree = newSet.size > 0 ? (0, _sourcesTree.collapseTree)(uncollapsedTree) : this.state.sourceTree; + + this.setState({ + uncollapsedTree, + sourceTree, + parentMap: (0, _sourcesTree.createParentMap)(sourceTree) + }); + } + + focusItem(item) { + this.setState({ focusedItem: item }); + } + + selectItem(item) { + if (!(0, _sourcesTree.nodeHasChildren)(item)) { + this.props.selectSource(item.contents.get("id")); + } + } + + getIcon(item, depth) { + if (depth === 0) { + return (0, _Svg2.default)("domain"); + } + + if (!(0, _sourcesTree.nodeHasChildren)(item)) { + return (0, _Svg2.default)("file"); + } + + return (0, _Svg2.default)("folder"); + } + + onContextMenu(event, item) { + var copySourceUrlLabel = L10N.getStr("copySourceUrl"); + var copySourceUrlKey = L10N.getStr("copySourceUrl.accesskey"); + + event.stopPropagation(); + event.preventDefault(); + + var menuOptions = []; + + if (!(0, _sourcesTree.isDirectory)(item)) { + var source = item.contents.get("url"); + var copySourceUrl = { + id: "node-menu-copy-source", + label: copySourceUrlLabel, + accesskey: copySourceUrlKey, + disabled: false, + click: () => (0, _clipboard.copyToTheClipboard)(source) + }; + + menuOptions.push(copySourceUrl); + } + + (0, _devtoolsLaunchpad.showMenu)(event, menuOptions); + } + + renderItem(item, depth, focused, _, expanded, _ref) { + var setExpanded = _ref.setExpanded; + + var arrow = (0, _Svg2.default)("arrow", { + className: (0, _classnames2.default)({ + expanded: expanded, + hidden: !(0, _sourcesTree.nodeHasChildren)(item) + }), + onClick: e => { + e.stopPropagation(); + setExpanded(item, !expanded); + } + }); + + var icon = this.getIcon(item, depth); + var paddingDir = "paddingRight"; + if (document.body && document.body.parentElement) { + paddingDir = document.body.parentElement.dir == "ltr" ? "paddingLeft" : "paddingRight"; + } + + return _react.DOM.div({ + className: (0, _classnames2.default)("node", { focused }), + style: { [paddingDir]: `${depth * 15}px` }, + key: item.path, + onClick: () => { + this.selectItem(item); + setExpanded(item, !expanded); + }, + onContextMenu: e => this.onContextMenu(e, item) + }, _react.DOM.div(null, arrow, icon, item.name)); + } + + render() { + var isHidden = this.props.isHidden; + var _state = this.state, + focusedItem = _state.focusedItem, + sourceTree = _state.sourceTree, + parentMap = _state.parentMap, + listItems = _state.listItems, + highlightItems = _state.highlightItems; + + + var isEmpty = sourceTree.contents.length === 0; + + var tree = ManagedTree({ + key: isEmpty ? "empty" : "full", + getParent: item => { + return parentMap.get(item); + }, + getChildren: item => { + if ((0, _sourcesTree.nodeHasChildren)(item)) { + return item.contents; + } + return []; + }, + getRoots: () => sourceTree.contents, + getKey: (item, i) => item.path, + itemHeight: 21, + autoExpandDepth: 1, + autoExpandAll: false, + onFocus: this.focusItem, + listItems, + highlightItems, + renderItem: this.renderItem + }); + + var noSourcesMessage = _react.DOM.div({ + className: "no-sources-message" + }, L10N.getStr("sources.noSourcesAvailable")); + + if (isEmpty) { + return noSourcesMessage; + } + return _react.DOM.div({ + className: (0, _classnames2.default)("sources-list", { hidden: isHidden }), + onKeyDown: e => { + if (e.keyCode === 13 && focusedItem) { + this.selectItem(focusedItem); + } + } + }, tree); + } + } + + SourcesTree.propTypes = { + isHidden: _react.PropTypes.bool, + sources: _reactImmutableProptypes2.default.map.isRequired, + selectSource: _react.PropTypes.func.isRequired, + shownSource: _react.PropTypes.string, + selectedSource: _reactImmutableProptypes2.default.map, + debuggeeUrl: _react.PropTypes.string.isRequired + }; + + SourcesTree.displayName = "SourcesTree"; + + exports.default = (0, _reactRedux.connect)(state => { + return { + shownSource: (0, _selectors.getShownSource)(state), + selectedSource: (0, _selectors.getSelectedSource)(state), + debuggeeUrl: (0, _selectors.getDebuggeeUrl)(state) + }; + }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SourcesTree); + +/***/ }, +/* 1149 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }, +/* 1150 */, +/* 1151 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + var React = __webpack_require__(2); + var InlineSVG = __webpack_require__(346); + + var svg = { + "arrow": __webpack_require__(1152), + "open-inspector": __webpack_require__(1153) + }; + + Svg.propTypes = { + className: React.PropTypes.string + }; + + function Svg(name, props) { + if (!svg[name]) { + throw new Error("Unknown SVG: " + name); + } + var className = name; + if (props && props.className) { + className = `${name} ${props.className}`; + } + if (name === "subSettings") { + className = ""; + } + props = Object.assign({}, props, { className, src: svg[name] }); + return React.createElement(InlineSVG, props); + } + + module.exports = Svg; + +/***/ }, +/* 1152 */ +/***/ function(module, exports) { + + module.exports = "" + +/***/ }, +/* 1153 */ +/***/ function(module, exports) { + + module.exports = "" + +/***/ }, +/* 1154 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + var _require = __webpack_require__(2), + Component = _require.Component, + createFactory = _require.createFactory, + dom = _require.DOM, + PropTypes = _require.PropTypes; + + var Tree = createFactory(__webpack_require__(1007).Tree); + __webpack_require__(1155); + + var classnames = __webpack_require__(175); + var Svg = __webpack_require__(1151); + + var _require2 = __webpack_require__(926), + Rep = _require2.REPS.Rep; + + var _require3 = __webpack_require__(925), + MODE = _require3.MODE; + + var _require4 = __webpack_require__(1157), + getChildren = _require4.getChildren, + getValue = _require4.getValue, + isDefault = _require4.isDefault, + nodeHasProperties = _require4.nodeHasProperties, + nodeIsMissingArguments = _require4.nodeIsMissingArguments, + nodeIsOptimizedOut = _require4.nodeIsOptimizedOut, + nodeIsPrimitive = _require4.nodeIsPrimitive; + + // This implements a component that renders an interactive inspector + // for looking at JavaScript objects. It expects descriptions of + // objects from the protocol, and will dynamically fetch child + // properties as objects are expanded. + // + // If you want to inspect a single object, pass the name and the + // protocol descriptor of it: + // + // ObjectInspector({ + // name: "foo", + // desc: { writable: true, ..., { value: { actor: "1", ... }}}, + // ... + // }) + // + // If you want multiple top-level objects (like scopes), you can pass + // an array of manually constructed nodes as `roots`: + // + // ObjectInspector({ + // roots: [{ name: ... }, ...], + // ... + // }); + + // There are 3 types of nodes: a simple node with a children array, an + // object that has properties that should be children when they are + // fetched, and a primitive value that should be displayed with no + // children. + + class ObjectInspector extends Component { + constructor() { + super(); + + this.actors = {}; + this.state = { + expandedKeys: new Set(), + focusedItem: null + }; + + var self = this; + + self.getChildren = this.getChildren.bind(this); + self.renderTreeItem = this.renderTreeItem.bind(this); + self.setExpanded = this.setExpanded.bind(this); + self.focusItem = this.focusItem.bind(this); + self.getRoots = this.getRoots.bind(this); + } + + isDefaultProperty(item) { + var roots = this.props.roots; + return isDefault(item, roots); + } + + getParent(item) { + return null; + } + + getChildren(item) { + var getObjectProperties = this.props.getObjectProperties; + var actors = this.actors; + + + return getChildren({ + getObjectProperties, + actors, + item + }); + } + + getRoots() { + return this.props.roots; + } + + getKey(item) { + return item.path; + } + + setExpanded(item, expand) { + var expandedKeys = this.state.expandedKeys; + + var key = this.getKey(item); + + if (expand === true) { + expandedKeys.add(key); + } else { + expandedKeys.delete(key); + } + + this.setState({ expandedKeys }); + + if (expand === true) { + var _props = this.props, + _getObjectProperties = _props.getObjectProperties, + _loadObjectProperties = _props.loadObjectProperties; + + + var _value = getValue(item); + if (nodeHasProperties(item) && _value && !_getObjectProperties(_value.actor)) { + _loadObjectProperties(_value); + } + } + } + + focusItem(item) { + if (!this.props.disabledFocus && this.state.focusedItem !== item) { + this.setState({ + focusedItem: item + }); + + if (this.props.onFocus) { + this.props.onFocus(item); + } + } + } + + renderTreeItem(item, depth, focused, arrow, expanded) { + var objectValue = void 0; + var label = item.name; + var itemValue = getValue(item); + + var unavailable = nodeIsPrimitive(item) && itemValue && itemValue.hasOwnProperty && itemValue.hasOwnProperty("unavailable"); + + if (nodeIsOptimizedOut(item)) { + objectValue = dom.span({ className: "unavailable" }, "(optimized away)"); + } else if (nodeIsMissingArguments(item) || unavailable) { + objectValue = dom.span({ className: "unavailable" }, "(unavailable)"); + } else if (nodeHasProperties(item) || nodeIsPrimitive(item)) { + var _mode = void 0; + if (depth === 0) { + _mode = this.props.mode; + } else { + _mode = this.props.mode === MODE.LONG ? MODE.SHORT : MODE.TINY; + } + + objectValue = this.renderGrip(item, this.props, _mode); + } + + var SINGLE_INDENT_WIDTH = 15; + var indentWidth = (depth + (nodeIsPrimitive(item) ? 1 : 0)) * SINGLE_INDENT_WIDTH; + + var _props2 = this.props, + onDoubleClick = _props2.onDoubleClick, + onLabelClick = _props2.onLabelClick; + + + return dom.div({ + className: classnames("node object-node", { + focused, + "default-property": this.isDefaultProperty(item) + }), + style: { + marginLeft: indentWidth + }, + onClick: e => { + e.stopPropagation(); + this.setExpanded(item, !expanded); + }, + onDoubleClick: onDoubleClick ? e => { + e.stopPropagation(); + onDoubleClick(item, { + depth, + focused, + expanded + }); + } : null + }, nodeIsPrimitive(item) === false ? Svg("arrow", { + className: classnames({ + expanded: expanded + }) + }) : null, label ? dom.span({ + className: "object-label", + onClick: onLabelClick ? event => { + event.stopPropagation(); + onLabelClick(item, { + depth, + focused, + expanded, + setExpanded: this.setExpanded + }); + } : null + }, label) : null, label && objectValue ? dom.span({ className: "object-delimiter" }, " : ") : null, objectValue); + } + + renderGrip(item, props) { + var mode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : MODE.TINY; + + var object = getValue(item); + return Rep(Object.assign({}, props, { + object, + mode + })); + } + + render() { + var _props3 = this.props, + _props3$autoExpandDep = _props3.autoExpandDepth, + autoExpandDepth = _props3$autoExpandDep === undefined ? 1 : _props3$autoExpandDep, + _props3$autoExpandAll = _props3.autoExpandAll, + autoExpandAll = _props3$autoExpandAll === undefined ? true : _props3$autoExpandAll, + disabledFocus = _props3.disabledFocus, + _props3$itemHeight = _props3.itemHeight, + itemHeight = _props3$itemHeight === undefined ? 20 : _props3$itemHeight, + _props3$disableWrap = _props3.disableWrap, + disableWrap = _props3$disableWrap === undefined ? false : _props3$disableWrap; + var _state = this.state, + expandedKeys = _state.expandedKeys, + focusedItem = _state.focusedItem; + + + var roots = this.getRoots(); + if (roots.length === 1 && nodeIsPrimitive(roots[0])) { + return this.renderGrip(roots[0], this.props, this.props.mode); + } + + return Tree({ + className: disableWrap ? "nowrap" : "", + autoExpandAll, + autoExpandDepth, + disabledFocus, + itemHeight, + + isExpanded: item => expandedKeys.has(this.getKey(item)), + focused: focusedItem, + + getRoots: this.getRoots, + getParent: this.getParent, + getChildren: this.getChildren, + getKey: this.getKey, + + onExpand: item => this.setExpanded(item, true), + onCollapse: item => this.setExpanded(item, false), + onFocus: this.focusItem, + + renderItem: this.renderTreeItem + }); + } + } + + ObjectInspector.displayName = "ObjectInspector"; + + ObjectInspector.propTypes = { + autoExpandAll: PropTypes.bool, + autoExpandDepth: PropTypes.number, + disabledFocus: PropTypes.bool, + disableWrap: PropTypes.bool, + roots: PropTypes.array, + getObjectProperties: PropTypes.func.isRequired, + loadObjectProperties: PropTypes.func.isRequired, + itemHeight: PropTypes.number, + mode: PropTypes.oneOf(Object.values(MODE)), + onFocus: PropTypes.func, + onDoubleClick: PropTypes.func, + onLabelClick: PropTypes.func + }; + + module.exports = ObjectInspector; + +/***/ }, +/* 1155 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }, +/* 1156 */, +/* 1157 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + 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); } } + + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + + var get = __webpack_require__(67); + + var _require = __webpack_require__(927), + maybeEscapePropertyName = _require.maybeEscapePropertyName; + + var WINDOW_PROPERTIES = {}; + + if (typeof window === "object") { + WINDOW_PROPERTIES = Object.getOwnPropertyNames(window); + } + + function getValue(item) { + return get(item, "contents.value", undefined); + } + + function isBucket(item) { + return item.path && item.path.match(/bucket(\d+)$/); + } + + function nodeHasChildren(item) { + return Array.isArray(item.contents) || isBucket(item); + } + + function nodeIsObject(item) { + var value = getValue(item); + return value && value.type === "object"; + } + + function nodeIsArray(value) { + return value && value.class === "Array"; + } + + function nodeIsFunction(item) { + var value = getValue(item); + return value && value.class === "Function"; + } + + function nodeIsOptimizedOut(item) { + var value = getValue(item); + return !nodeHasChildren(item) && value && value.optimizedOut; + } + + function nodeIsMissingArguments(item) { + var value = getValue(item); + return !nodeHasChildren(item) && value && value.missingArguments; + } + + function nodeHasProperties(item) { + return !nodeHasChildren(item) && nodeIsObject(item); + } + + function nodeIsPrimitive(item) { + return !nodeHasChildren(item) && !nodeHasProperties(item); + } + + function isPromise(item) { + var value = getValue(item); + return value.class == "Promise"; + } + + function getPromiseProperties(item) { + var _getValue = getValue(item), + _getValue$promiseStat = _getValue.promiseState, + reason = _getValue$promiseStat.reason, + value = _getValue$promiseStat.value, + state = _getValue$promiseStat.state; + + var properties = []; + + if (state) { + properties.push(createNode("", `${item.path}/state`, { value: state })); + } + + if (reason) { + properties.push(createNode("", `${item.path}/reason`, { value: reason })); + } + + if (value) { + properties.push(createNode("", `${item.path}/value`, { value: value })); + } + + return properties; + } + + function isDefault(item, roots) { + if (roots && roots.length === 1) { + var value = getValue(roots[0]); + return value.class === "Window"; + } + return WINDOW_PROPERTIES.includes(item.name); + } + + function sortProperties(properties) { + return properties.sort((a, b) => { + // Sort numbers in ascending order and sort strings lexicographically + var aInt = parseInt(a, 10); + var bInt = parseInt(b, 10); + + if (isNaN(aInt) || isNaN(bInt)) { + return a > b ? 1 : -1; + } + + return aInt - bInt; + }); + } + + function makeNumericalBuckets(props, bucketSize, parentPath, ownProperties) { + var numProperties = props.length; + var numBuckets = Math.ceil(numProperties / bucketSize); + var buckets = []; + + var _loop = function (i) { + var bucketKey = `bucket${i}`; + var minKey = (i - 1) * bucketSize; + var maxKey = Math.min(i * bucketSize - 1, numProperties); + var bucketName = `[${minKey}..${maxKey}]`; + var bucketProperties = props.slice(minKey, maxKey); + + var bucketNodes = bucketProperties.map(name => createNode(name, `${parentPath}/${bucketKey}/${name}`, ownProperties[name])); + + buckets.push(createNode(bucketName, `${parentPath}/${bucketKey}`, bucketNodes)); + }; + + for (var i = 1; i <= numBuckets; i++) { + _loop(i); + } + return buckets; + } + + function makeDefaultPropsBucket(props, parentPath, ownProperties) { + var userProps = props.filter(name => !isDefault({ name })); + var defaultProps = props.filter(name => isDefault({ name })); + + var nodes = makeNodesForOwnProps(userProps, parentPath, ownProperties); + + if (defaultProps.length > 0) { + var defaultNodes = defaultProps.map((name, index) => createNode(maybeEscapePropertyName(name), `${parentPath}/bucket${index}/${name}`, ownProperties[name])); + nodes.push(createNode("[default properties]", `${parentPath}/##-default`, defaultNodes)); + } + return nodes; + } + + function makeNodesForOwnProps(properties, parentPath, ownProperties) { + return properties.map(name => createNode(maybeEscapePropertyName(name), `${parentPath}/${name}`, ownProperties[name])); + } + + /* + * Ignore non-concrete values like getters and setters + * for now by making sure we have a value. + */ + function makeNodesForProperties(objProps, parent) { + var _ref = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}, + _ref$bucketSize = _ref.bucketSize, + bucketSize = _ref$bucketSize === undefined ? 100 : _ref$bucketSize; + + var ownProperties = objProps.ownProperties, + prototype = objProps.prototype, + ownSymbols = objProps.ownSymbols; + + var parentPath = parent.path; + var parentValue = getValue(parent); + var properties = sortProperties(Object.keys(ownProperties)).filter(name => ownProperties[name].hasOwnProperty("value")); + + var numProperties = properties.length; + + var nodes = []; + if (nodeIsArray(prototype) && numProperties > bucketSize) { + nodes = makeNumericalBuckets(properties, bucketSize, parentPath, ownProperties); + } else if (parentValue.class == "Window") { + nodes = makeDefaultPropsBucket(properties, parentPath, ownProperties); + } else { + nodes = makeNodesForOwnProps(properties, parentPath, ownProperties); + } + + for (var index in ownSymbols) { + nodes.push(createNode(ownSymbols[index].name, `${parentPath}/##symbol-${index}`, ownSymbols[index].descriptor)); + } + + if (isPromise(parent)) { + var _nodes; + + (_nodes = nodes).push.apply(_nodes, _toConsumableArray(getPromiseProperties(parent))); + } + + // Add the prototype if it exists and is not null + if (prototype && prototype.type !== "null") { + nodes.push(createNode("__proto__", `${parentPath}/__proto__`, { value: prototype })); + } + + return nodes; + } + + function createNode(name, path, contents) { + if (contents === undefined) { + return null; + } + // The path is important to uniquely identify the item in the entire + // tree. This helps debugging & optimizes React's rendering of large + // lists. The path will be separated by property name, + // i.e. `{ foo: { bar: { baz: 5 }}}` will have a path of `foo/bar/baz` + // for the inner object. + return { name, path, contents }; + } + + function getChildren(_ref2) { + var getObjectProperties = _ref2.getObjectProperties, + actors = _ref2.actors, + item = _ref2.item; + + var obj = item.contents; + + // Nodes can either have children already, or be an object with + // properties that we need to go and fetch. + if (nodeHasChildren(item)) { + return item.contents; + } + + if (!nodeHasProperties(item)) { + return []; + } + + var actor = obj.value.actor; + + // Because we are dynamically creating the tree as the user + // expands it (not precalculated tree structure), we cache child + // arrays. This not only helps performance, but is necessary + // because the expanded state depends on instances of nodes + // being the same across renders. If we didn't do this, each + // node would be a new instance every render. + var key = item.path; + if (actors && actors[key]) { + return actors[key]; + } + + if (isBucket(item)) { + return item.contents.children; + } + + var loadedProps = getObjectProperties(actor); + + var _ref3 = loadedProps || {}, + ownProperties = _ref3.ownProperties, + prototype = _ref3.prototype; + + if (!ownProperties && !prototype) { + return []; + } + + var children = makeNodesForProperties(loadedProps, item); + actors[key] = children; + return children; + } + + module.exports = { + createNode, + getChildren, + getPromiseProperties, + getValue, + isDefault, + isPromise, + makeNodesForProperties, + nodeHasChildren, + nodeHasProperties, + nodeIsFunction, + nodeIsMissingArguments, + nodeIsObject, + nodeIsOptimizedOut, + nodeIsPrimitive, + sortProperties + }; + +/***/ }, +/* 1158 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _reactRedux = __webpack_require__(151); + + var _redux = __webpack_require__(3); + + var _react = __webpack_require__(2); + + var _devtoolsConfig = __webpack_require__(828); + + var _Breakpoint2 = __webpack_require__(714); + + var _Breakpoint3 = _interopRequireDefault(_Breakpoint2); + + var _actions = __webpack_require__(244); + + var _actions2 = _interopRequireDefault(_actions); + + var _selectors = __webpack_require__(242); + + var _visibleBreakpoints = __webpack_require__(1135); + + var _visibleBreakpoints2 = _interopRequireDefault(_visibleBreakpoints); + + var _breakpoint = __webpack_require__(1057); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var Breakpoint = (0, _react.createFactory)(_Breakpoint3.default); + + class Breakpoints extends _react.Component { + + shouldComponentUpdate(nextProps) { + if (nextProps.selectedSource && nextProps.selectedSource.get("loading")) { + return false; + } + + return true; + } + + render() { + var _props = this.props, + breakpoints = _props.breakpoints, + selectedSource = _props.selectedSource, + editor = _props.editor; + + + if (!selectedSource || !breakpoints || selectedSource.get("isBlackBoxed")) { + return null; + } + + return _react.DOM.div({}, breakpoints.valueSeq().filter(b => (0, _devtoolsConfig.isEnabled)("columnBreakpoints") ? !b.location.column : true).map(bp => Breakpoint({ + key: (0, _breakpoint.makeLocationId)(bp.location), + breakpoint: bp, + selectedSource, + editor: editor + }))); + } + } + + Breakpoints.displayName = "Breakpoints"; + + exports.default = (0, _reactRedux.connect)(state => ({ + breakpoints: (0, _visibleBreakpoints2.default)(state), + selectedSource: (0, _selectors.getSelectedSource)(state) + }), dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(Breakpoints); + +/***/ }, +/* 1159 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; + + var _react = __webpack_require__(2); + + var _reactRedux = __webpack_require__(151); + + var _redux = __webpack_require__(3); + + var _devtoolsConfig = __webpack_require__(828); + + var _range = __webpack_require__(1026); + + var _range2 = _interopRequireDefault(_range); + + var _keyBy = __webpack_require__(1160); + + var _keyBy2 = _interopRequireDefault(_keyBy); + + var _find = __webpack_require__(1164); + + var _find2 = _interopRequireDefault(_find); + + var _isEqualWith = __webpack_require__(1166); + + var _isEqualWith2 = _interopRequireDefault(_isEqualWith); + + var _CallSite2 = __webpack_require__(1167); + + var _CallSite3 = _interopRequireDefault(_CallSite2); + + var _selectors = __webpack_require__(242); + + var _editor = __webpack_require__(257); + + var _actions = __webpack_require__(244); + + var _actions2 = _interopRequireDefault(_actions); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var CallSite = (0, _react.createFactory)(_CallSite3.default); + + function getCallSiteAtLocation(callSites, location) { + return (0, _find2.default)(callSites, callSite => (0, _isEqualWith2.default)(callSite.location, location, (cloc, loc) => { + return loc.line === cloc.start.line && loc.column >= cloc.start.column && loc.column <= cloc.end.column; + })); + } + + class CallSites extends _react.Component { + + constructor(props) { + super(props); + this.onKeyDown = this.onKeyDown.bind(this); + this.onKeyUp = this.onKeyUp.bind(this); + + this.state = { + showCallSites: false + }; + } + + componentDidMount() { + var editor = this.props.editor; + + var codeMirrorWrapper = editor.codeMirror.getWrapperElement(); + + codeMirrorWrapper.addEventListener("click", e => this.onTokenClick(e)); + document.body.addEventListener("keydown", this.onKeyDown); + document.body.addEventListener("keyup", this.onKeyUp); + } + + componentDidUnMount() { + var editor = this.props.editor; + + var codeMirrorWrapper = editor.codeMirror.getWrapperElement(); + + codeMirrorWrapper.addEventListener("click", e => this.onTokenClick(e)); + document.body.removeEventListener("keydown", e => this.onKeyDown); + document.body.removeEventListener("keyup", this.onKeyUp); + } + + onKeyUp(e) { + if (e.key === "Alt") { + e.preventDefault(); + this.setState({ showCallSites: false }); + } + } + + onKeyDown(e) { + if (e.key === "Alt") { + e.preventDefault(); + this.setState({ showCallSites: true }); + } + } + + onTokenClick(e) { + var target = e.target; + var editor = this.props.editor; + + + if (!(0, _devtoolsConfig.isEnabled)("columnBreakpoints") || !e.altKey || !target.classList.contains("call-site") && !target.classList.contains("call-site-bp")) { + return; + } + + var _getTokenLocation = (0, _editor.getTokenLocation)(editor.codeMirror, target), + line = _getTokenLocation.line, + column = _getTokenLocation.column; + + this.toggleBreakpoint(line + 1, column - 2); + } + + toggleBreakpoint(line) { + var column = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + var _props = this.props, + selectedSource = _props.selectedSource, + selectedLocation = _props.selectedLocation, + addBreakpoint = _props.addBreakpoint, + removeBreakpoint = _props.removeBreakpoint, + callSites = _props.callSites; + + + var callSite = getCallSiteAtLocation(callSites, { line, column }); + + if (!callSite) { + return; + } + + var bp = callSite.breakpoint; + + if (bp && bp.loading || !selectedLocation || !selectedSource) { + return; + } + + var sourceId = selectedLocation.sourceId; + + + if (bp) { + // NOTE: it's possible the breakpoint has slid to a column + column = column || bp.location.column; + removeBreakpoint({ + sourceId: sourceId, + line: line, + column + }); + } else { + addBreakpoint({ + sourceId: sourceId, + sourceUrl: selectedSource.get("url"), + line: line, + column: column + }); + } + } + + render() { + var _props2 = this.props, + editor = _props2.editor, + callSites = _props2.callSites; + var showCallSites = this.state.showCallSites; + + var sites = void 0; + if (!callSites) { + return null; + } + + editor.codeMirror.operation(() => { + sites = _react.DOM.div({}, callSites.map((callSite, index) => { + return CallSite({ + key: index, + callSite, + editor, + breakpoint: callSite.breakpoint, + showCallSite: showCallSites + }); + })); + }); + return sites; + } + } + + CallSites.displayName = "CallSites"; + function getCallSites(symbols, breakpoints) { + if (!symbols || !symbols.callExpressions) { + return; + } + + var callSites = symbols.callExpressions; + + // NOTE: we create a breakpoint map keyed on location + // to speed up the lookups. Hopefully we'll fix the + // inconsistency with column offsets so that we can expect + // a breakpoint to be added at the beginning of a call expression. + var bpLocationMap = (0, _keyBy2.default)(breakpoints.valueSeq().toJS(), (_ref) => { + var location = _ref.location; + return locationKey(location); + }); + + function locationKey(_ref2) { + var line = _ref2.line, + column = _ref2.column; + + return `${line}/${column}`; + } + + function findBreakpoint(callSite) { + var _callSite$location = callSite.location, + start = _callSite$location.start, + end = _callSite$location.end; + + + var breakpointId = (0, _range2.default)(start.column - 1, end.column).map(column => locationKey({ line: start.line, column })).find(key => bpLocationMap[key]); + + if (breakpointId) { + return bpLocationMap[breakpointId]; + } + } + + return callSites.filter((_ref3) => { + var location = _ref3.location; + return location.start.line === location.end.line; + }).map(callSite => _extends({}, callSite, { breakpoint: findBreakpoint(callSite) })); + } + + exports.default = (0, _reactRedux.connect)(state => { + var selectedLocation = (0, _selectors.getSelectedLocation)(state); + var selectedSource = (0, _selectors.getSelectedSource)(state); + var sourceId = selectedLocation && selectedLocation.sourceId; + var source = selectedSource && selectedSource.toJS(); + + var symbols = (0, _selectors.getSymbols)(state, source); + var breakpoints = (0, _selectors.getBreakpointsForSource)(state, sourceId); + + return { + selectedLocation, + selectedSource, + callSites: getCallSites(symbols, breakpoints), + breakpoints: breakpoints + }; + }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(CallSites); + +/***/ }, +/* 1160 */ +/***/ function(module, exports, __webpack_require__) { + + var baseAssignValue = __webpack_require__(115), + createAggregator = __webpack_require__(1161); + + /** + * Creates an object composed of keys generated from the results of running + * each element of `collection` thru `iteratee`. The corresponding value of + * each key is the last element responsible for generating the key. The + * iteratee is invoked with one argument: (value). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Collection + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} [iteratee=_.identity] The iteratee to transform keys. + * @returns {Object} Returns the composed aggregate object. + * @example + * + * var array = [ + * { 'dir': 'left', 'code': 97 }, + * { 'dir': 'right', 'code': 100 } + * ]; + * + * _.keyBy(array, function(o) { + * return String.fromCharCode(o.code); + * }); + * // => { 'a': { 'dir': 'left', 'code': 97 }, 'd': { 'dir': 'right', 'code': 100 } } + * + * _.keyBy(array, 'dir'); + * // => { 'left': { 'dir': 'left', 'code': 97 }, 'right': { 'dir': 'right', 'code': 100 } } + */ + var keyBy = createAggregator(function(result, value, key) { + baseAssignValue(result, key, value); + }); + + module.exports = keyBy; + + +/***/ }, +/* 1161 */ +/***/ function(module, exports, __webpack_require__) { + + var arrayAggregator = __webpack_require__(1162), + baseAggregator = __webpack_require__(1163), + baseIteratee = __webpack_require__(264), + isArray = __webpack_require__(70); + + /** + * Creates a function like `_.groupBy`. + * + * @private + * @param {Function} setter The function to set accumulator values. + * @param {Function} [initializer] The accumulator object initializer. + * @returns {Function} Returns the new aggregator function. + */ + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, + accumulator = initializer ? initializer() : {}; + + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; + } + + module.exports = createAggregator; + + +/***/ }, +/* 1162 */ +/***/ function(module, exports) { + + /** + * A specialized version of `baseAggregator` for arrays. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, + length = array == null ? 0 : array.length; + + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); + } + return accumulator; + } + + module.exports = arrayAggregator; + + +/***/ }, +/* 1163 */ +/***/ function(module, exports, __webpack_require__) { + + var baseEach = __webpack_require__(1070); + + /** + * Aggregates elements of `collection` on `accumulator` with keys transformed + * by `iteratee` and values set by `setter`. + * + * @private + * @param {Array|Object} collection The collection to iterate over. + * @param {Function} setter The function to set `accumulator` values. + * @param {Function} iteratee The iteratee to transform keys. + * @param {Object} accumulator The initial aggregated object. + * @returns {Function} Returns `accumulator`. + */ + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection) { + setter(accumulator, value, iteratee(value), collection); + }); + return accumulator; + } + + module.exports = baseAggregator; + + +/***/ }, +/* 1164 */ +/***/ function(module, exports, __webpack_require__) { + + var createFind = __webpack_require__(1165), + findIndex = __webpack_require__(262); + + /** + * Iterates over elements of `collection`, returning the first element + * `predicate` returns truthy for. The predicate is invoked with three + * arguments: (value, index|key, collection). + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Collection + * @param {Array|Object} collection The collection to inspect. + * @param {Function} [predicate=_.identity] The function invoked per iteration. + * @param {number} [fromIndex=0] The index to search from. + * @returns {*} Returns the matched element, else `undefined`. + * @example + * + * var users = [ + * { 'user': 'barney', 'age': 36, 'active': true }, + * { 'user': 'fred', 'age': 40, 'active': false }, + * { 'user': 'pebbles', 'age': 1, 'active': true } + * ]; + * + * _.find(users, function(o) { return o.age < 40; }); + * // => object for 'barney' + * + * // The `_.matches` iteratee shorthand. + * _.find(users, { 'age': 1, 'active': true }); + * // => object for 'pebbles' + * + * // The `_.matchesProperty` iteratee shorthand. + * _.find(users, ['active', false]); + * // => object for 'fred' + * + * // The `_.property` iteratee shorthand. + * _.find(users, 'active'); + * // => object for 'barney' + */ + var find = createFind(findIndex); + + module.exports = find; + + +/***/ }, +/* 1165 */ +/***/ function(module, exports, __webpack_require__) { + + var baseIteratee = __webpack_require__(264), + isArrayLike = __webpack_require__(220), + keys = __webpack_require__(205); + + /** + * Creates a `_.find` or `_.findLast` function. + * + * @private + * @param {Function} findIndexFunc The function to find the collection index. + * @returns {Function} Returns the new find function. + */ + function createFind(findIndexFunc) { + return function(collection, predicate, fromIndex) { + var iterable = Object(collection); + if (!isArrayLike(collection)) { + var iteratee = baseIteratee(predicate, 3); + collection = keys(collection); + predicate = function(key) { return iteratee(iterable[key], key, iterable); }; + } + var index = findIndexFunc(collection, predicate, fromIndex); + return index > -1 ? iterable[iteratee ? collection[index] : index] : undefined; + }; + } + + module.exports = createFind; + + +/***/ }, +/* 1166 */ +/***/ function(module, exports, __webpack_require__) { + + var baseIsEqual = __webpack_require__(273); + + /** + * This method is like `_.isEqual` except that it accepts `customizer` which + * is invoked to compare values. If `customizer` returns `undefined`, comparisons + * are handled by the method instead. The `customizer` is invoked with up to + * six arguments: (objValue, othValue [, index|key, object, other, stack]). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @param {Function} [customizer] The function to customize comparisons. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * function isGreeting(value) { + * return /^h(?:i|ello)$/.test(value); + * } + * + * function customizer(objValue, othValue) { + * if (isGreeting(objValue) && isGreeting(othValue)) { + * return true; + * } + * } + * + * var array = ['hello', 'goodbye']; + * var other = ['hi', 'goodbye']; + * + * _.isEqualWith(array, other, customizer); + * // => true + */ + function isEqualWith(value, other, customizer) { + customizer = typeof customizer == 'function' ? customizer : undefined; + var result = customizer ? customizer(value, other) : undefined; + return result === undefined ? baseIsEqual(value, other, undefined, customizer) : !!result; + } + + module.exports = isEqualWith; + + +/***/ }, +/* 1167 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _react = __webpack_require__(2); + + var _editor = __webpack_require__(257); + + __webpack_require__(1168); + + class CallSite extends _react.Component { + + constructor() { + super(); + + this.marker = undefined; + var self = this; + self.addCallSite = this.addCallSite.bind(this); + self.clearCallSite = this.clearCallSite.bind(this); + } + + addCallSite(nextProps) { + var _ref = nextProps || this.props, + editor = _ref.editor, + callSite = _ref.callSite, + breakpoint = _ref.breakpoint; + + var className = !breakpoint ? "call-site" : "call-site-bp"; + this.marker = (0, _editor.markText)(editor, className, callSite.location); + } + + clearCallSite() { + if (this.marker) { + this.marker.clear(); + this.marker = null; + } + } + + shouldComponentUpdate(nextProps) { + return this.props.editor !== nextProps.editor; + } + + componentDidMount() { + var _props = this.props, + breakpoint = _props.breakpoint, + editor = _props.editor, + showCallSite = _props.showCallSite; + + if (!editor) { + return; + } + + if (!breakpoint && !showCallSite) { + return; + } + + this.addCallSite(); + } + + componentWillReceiveProps(nextProps) { + var _props2 = this.props, + breakpoint = _props2.breakpoint, + showCallSite = _props2.showCallSite; + + + if (nextProps.breakpoint !== breakpoint) { + if (this.marker) { + this.marker.clear(); + } + this.addCallSite(nextProps); + } + + if (nextProps.showCallSite !== showCallSite) { + if (nextProps.showCallSite) { + if (!this.marker) { + this.addCallSite(); + } + } else if (!nextProps.breakpoint) { + this.clearCallSite(); + } + } + } + + componentWillUnmount() { + if (!this.props.editor || !this.marker) { + return; + } + this.marker.clear(); + } + + render() { + return null; + } + } + + exports.default = CallSite; + CallSite.displayName = "CallSite"; + +/***/ }, +/* 1168 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + +/***/ }, +/* 1169 */, +/* 1170 */ +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _react = __webpack_require__(2); + + var _reactRedux = __webpack_require__(151); + + var _redux = __webpack_require__(3); + + var _fuzzaldrinPlus = __webpack_require__(161); + + var _selectors = __webpack_require__(242); + + var _actions = __webpack_require__(244); + + var _actions2 = _interopRequireDefault(_actions); + + var _resultList = __webpack_require__(343); + + var _SearchInput2 = __webpack_require__(377); + + var _SearchInput3 = _interopRequireDefault(_SearchInput2); + + var _ResultList2 = __webpack_require__(383); + + var _ResultList3 = _interopRequireDefault(_ResultList2); + + __webpack_require__(1171); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var SearchInput = (0, _react.createFactory)(_SearchInput3.default); + + var ResultList = (0, _react.createFactory)(_ResultList3.default); + + function formatSymbol(symbol) { + return { + id: `${symbol.name}:${symbol.location.start.line}`, + title: symbol.name, + subtitle: `:${symbol.location.start.line}`, + value: symbol.name, + location: symbol.location + }; + } + + class SymbolModal extends _react.Component { + + constructor(props) { + super(props); + this.state = { results: null, query: "", resultsIndex: 0 }; + + var self = this; + self.onClick = this.onClick.bind(this); + self.closeModal = this.closeModal.bind(this); + self.onChange = this.onChange.bind(this); + self.onKeyUp = this.onKeyUp.bind(this); + self.updateResults = this.updateResults.bind(this); + self.traverseResults = this.traverseResults.bind(this); + self.renderResults = this.renderResults.bind(this); + self.buildSummaryMsg = this.buildSummaryMsg.bind(this); + self.buildPlaceHolder = this.buildPlaceHolder.bind(this); + self.selectResultItem = this.selectResultItem.bind(this); + self.openSymbolModal = this.openSymbolModal.bind(this); + } + + componentWillUnmount() { + var shortcuts = this.context.shortcuts; + shortcuts.off("Escape"); + shortcuts.off(L10N.getStr("symbolSearch.search.key2")); + } + + componentDidMount() { + var shortcuts = this.context.shortcuts; + shortcuts.on("Escape", this.closeModal); + shortcuts.on(L10N.getStr("symbolSearch.search.key2"), this.openSymbolModal); + + this.updateResults(this.state.query); + } + + componentDidUpdate(prevProps, prevState) { + if (this.refs.resultList && this.refs.resultList.refs) { + (0, _resultList.scrollList)(this.refs.resultList.refs, this.state.resultsIndex); + } + + if (this.refs.searchInput && this.refs.searchInput.refs.input) { + this.refs.searchInput.refs.input.focus(); + } + + if (!prevProps.enabled && this.props.enabled) { + this.updateResults(this.state.query); + } + } + + openSymbolModal(_, e) { + e.preventDefault(); + this.props.setActiveSearch("symbol"); + } + + onClick(e) { + e.stopPropagation(); + } + + onChange(e) { + var selectedSource = this.props.selectedSource; + + if (!selectedSource || !selectedSource.get("text")) { + return; + } + + this.setState({ query: e.target.value }); + return this.updateResults(e.target.value); + } + + closeModal() { + this.props.closeActiveSearch(); + this.props.clearHighlightLineRange(); + } + + selectResultItem(e, item) { + var _props = this.props, + selectSource = _props.selectSource, + selectedSource = _props.selectedSource; + + + if (!selectedSource || !item) { + return; + } + + selectSource(selectedSource.get("id"), { + line: item.location.start.line + }); + + this.closeModal(); + } + + updateResults(query) { + var _props2 = this.props, + symbolType = _props2.symbolType, + symbols = _props2.symbols; + + + var symbolSearchResults = symbols[symbolType]; + + if (query == "") { + this.setState({ results: symbolSearchResults }); + return; + } + + symbolSearchResults = (0, _fuzzaldrinPlus.filter)(symbolSearchResults, query, { + key: "value" + }); + + this.setState({ results: symbolSearchResults }); + } + + traverseResults(direction) { + var _state = this.state, + resultsIndex = _state.resultsIndex, + results = _state.results; + + var resultCount = this.resultsCount(); + var index = resultsIndex + direction; + var nextIndex = (index + resultCount) % resultCount; + + this.setState({ resultsIndex: nextIndex }); + + if (results) { + this.onSelectResultItem(results[nextIndex]); + } + } + + onSelectResultItem(item) { + var _props3 = this.props, + selectSource = _props3.selectSource, + selectedSource = _props3.selectedSource, + symbolType = _props3.symbolType, + highlightLineRange = _props3.highlightLineRange; + + + if (selectedSource && symbolType !== "functions") { + selectSource(selectedSource.get("id"), { + line: item.location.start.line + }); + } + + if (selectedSource && symbolType === "functions") { + highlightLineRange({ + start: item.location.start.line, + end: item.location.end.line, + sourceId: selectedSource.get("id") + }); + } + } + + onKeyUp(e) { + e.preventDefault(); + var enabled = this.props.enabled; + var _state2 = this.state, + results = _state2.results, + resultsIndex = _state2.resultsIndex; + + + if (!enabled || !results) { + return; + } + + if (e.key === "ArrowUp") { + this.traverseResults(-1); + } else if (e.key === "ArrowDown") { + this.traverseResults(1); + } else if (e.key === "Enter") { + this.selectResultItem(e, results[resultsIndex]); + this.closeModal(); + } else if (e.key === "Tab") { + this.closeModal(); + } + } + + renderResults() { + var _state3 = this.state, + resultsIndex = _state3.resultsIndex, + results = _state3.results; + var enabled = this.props.enabled; + + if (!enabled || !results) { + return; + } + + return ResultList({ + items: results, + selected: resultsIndex, + selectItem: this.selectResultItem, + ref: "resultList" + }); + } + + renderInput() { + var query = this.state.query; + + + return SearchInput({ + query, + count: this.resultsCount(), + placeholder: this.buildPlaceHolder(), + summaryMsg: this.buildSummaryMsg(), + onChange: this.onChange, + onKeyUp: this.onKeyUp, + handleNext: () => this.traverseResults(1), + handlePrev: () => this.traverseResults(-1), + handleClose: this.closeModal, + ref: "searchInput" + }); + } + + buildSummaryMsg() { + var resultsIndex = this.state.resultsIndex; + + var count = this.resultsCount(); + + if (count > 1) { + return L10N.getFormatStr("editor.searchResults", resultsIndex + 1, count); + } else if (count === 1) { + return L10N.getFormatStr("editor.singleResult"); + } + } + + resultsCount() { + return this.state.results ? this.state.results.length : 0; + } + + buildPlaceHolder() { + var symbolType = this.props.symbolType; + + return L10N.getFormatStr(`symbolSearch.search.${symbolType}Placeholder`); + } + + render() { + var enabled = this.props.enabled; + + if (!enabled) { + return _react.DOM.div(); + } + return _react.DOM.div({ className: "symbol-modal-wrapper", onClick: this.closeModal }, _react.DOM.div({ className: "symbol-modal", onClick: this.onClick }, _react.DOM.div({ className: "input-wrapper" }, this.renderInput()), this.renderResults())); + } + } + + SymbolModal.displayName = "SymbolModal"; + SymbolModal.contextTypes = { + shortcuts: _react.PropTypes.object + }; + + function _getFormattedSymbols(state, source) { + if (!source) { + return { variables: [], functions: [] }; + } + + var _getSymbols = (0, _selectors.getSymbols)(state, source.toJS()), + variables = _getSymbols.variables, + functions = _getSymbols.functions; + + return { + variables: variables.map(formatSymbol), + functions: functions.map(formatSymbol) + }; + } + + exports.default = (0, _reactRedux.connect)(state => { + var source = (0, _selectors.getSelectedSource)(state); + return { + enabled: (0, _selectors.getActiveSearchState)(state) === "symbol", + symbolType: (0, _selectors.getSymbolSearchType)(state), + symbols: _getFormattedSymbols(state, source) + }; + }, dispatch => (0, _redux.bindActionCreators)(_actions2.default, dispatch))(SymbolModal); + +/***/ }, +/* 1171 */ +/***/ function(module, exports) { + + // removed by extract-text-webpack-plugin + /***/ } /******/ ]) }); diff --git a/devtools/client/debugger/new/parser-worker.js b/devtools/client/debugger/new/parser-worker.js index 276b654d785f..d3bc8d08f5e3 100644 --- a/devtools/client/debugger/new/parser-worker.js +++ b/devtools/client/debugger/new/parser-worker.js @@ -29870,6 +29870,10 @@ return /******/ (function(modules) { // webpackBootstrap /* 900 */ /***/ function(module, exports, __webpack_require__) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + const networkRequest = __webpack_require__(901); const workerUtils = __webpack_require__(902); @@ -29882,6 +29886,10 @@ return /******/ (function(modules) { // webpackBootstrap /* 901 */ /***/ function(module, exports) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + function networkRequest(url, opts) { return new Promise((resolve, reject) => { const req = new XMLHttpRequest(); @@ -29891,7 +29899,7 @@ return /******/ (function(modules) { // webpackBootstrap if (req.status === 200) { resolve({ content: req.responseText }); } else { - resolve(req.statusText); + reject(req.statusText); } } }); @@ -29921,7 +29929,9 @@ return /******/ (function(modules) { // webpackBootstrap function WorkerDispatcher() { this.msgId = 1; this.worker = null; - } + } /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ WorkerDispatcher.prototype = { start(url) { @@ -29952,7 +29962,6 @@ return /******/ (function(modules) { // webpackBootstrap } this.worker.removeEventListener("message", listener); - if (result.error) { reject(result.error); } else { @@ -30070,6 +30079,7 @@ return /******/ (function(modules) { // webpackBootstrap getClosestExpression: _closest.getClosestExpression, getOutOfScopeLocations: _getOutOfScopeLocations2.default, getSymbols: _getSymbols2.default, + clearSymbols: _getSymbols.clearSymbols, getVariablesInScope: _scopes.getVariablesInScope }); @@ -30473,6 +30483,8 @@ return /******/ (function(modules) { // webpackBootstrap value: true }); exports.default = getSymbols; + exports.formatSymbols = formatSymbols; + exports.clearSymbols = clearSymbols; var _ast = __webpack_require__(1051); @@ -30519,26 +30531,32 @@ return /******/ (function(modules) { // webpackBootstrap })); } - function getSymbols(source) { - if (symbolDeclarations.has(source.id)) { - var _symbols = symbolDeclarations.get(source.id); - if (_symbols) { - return _symbols; - } + function getComments(ast) { + if (!ast || !ast.comments) { + return []; } + return ast.comments.map(comment => ({ + name: comment.location, + location: comment.loc + })); + } - var symbols = { functions: [], variables: [] }; + function extractSymbols(source) { + var functions = []; + var variables = []; + var memberExpressions = []; + var callExpressions = []; + var objectProperties = []; + var identifiers = []; - (0, _ast.traverseAst)(source, { + var ast = (0, _ast.traverseAst)(source, { enter(path) { if ((0, _helpers.isVariable)(path)) { - var _symbols$variables; - - (_symbols$variables = symbols.variables).push.apply(_symbols$variables, _toConsumableArray(getVariableNames(path))); + variables.push.apply(variables, _toConsumableArray(getVariableNames(path))); } if ((0, _helpers.isFunction)(path)) { - symbols.functions.push({ + functions.push({ name: (0, _getFunctionName2.default)(path), location: path.node.loc, parameterNames: getFunctionParameterNames(path), @@ -30547,18 +30565,291 @@ return /******/ (function(modules) { // webpackBootstrap } if (t.isClassDeclaration(path)) { - symbols.variables.push({ + variables.push({ name: path.node.id.name, location: path.node.loc }); } + + if (t.isObjectProperty(path)) { + var _path$node$key$loc = path.node.key.loc, + start = _path$node$key$loc.start, + end = _path$node$key$loc.end, + identifierName = _path$node$key$loc.identifierName; + + objectProperties.push({ + name: identifierName, + location: { start, end }, + expression: getSnippet(path) + }); + } + + if (t.isMemberExpression(path)) { + var _path$node$property$l = path.node.property.loc, + _start = _path$node$property$l.start, + _end = _path$node$property$l.end; + + memberExpressions.push({ + name: path.node.property.name, + location: { start: _start, end: _end }, + expressionLocation: path.node.loc, + expression: getSnippet(path) + }); + } + + if (t.isCallExpression(path)) { + var callee = path.node.callee; + if (!t.isMemberExpression(callee)) { + var _callee$loc = callee.loc, + _start2 = _callee$loc.start, + _end2 = _callee$loc.end, + _identifierName = _callee$loc.identifierName; + + callExpressions.push({ + name: _identifierName, + location: { start: _start2, end: _end2 } + }); + } + } + + if (t.isIdentifier(path)) { + var _path$node$loc = path.node.loc, + _start3 = _path$node$loc.start, + _end3 = _path$node$loc.end; + + + identifiers.push({ + name: path.node.name, + expression: path.node.name, + location: { start: _start3, end: _end3 } + }); + } + + if (t.isThisExpression(path.node)) { + var _path$node$loc2 = path.node.loc, + _start4 = _path$node$loc2.start, + _end4 = _path$node$loc2.end; + + identifiers.push({ + name: "this", + location: { start: _start4, end: _end4 }, + expressionLocation: path.node.loc, + expression: "this" + }); + } + + if (t.isVariableDeclarator(path)) { + var node = path.node.id; + var _path$node$loc3 = path.node.loc, + _start5 = _path$node$loc3.start, + _end5 = _path$node$loc3.end; + + + identifiers.push({ + name: node.name, + expression: node.name, + location: { start: _start5, end: _end5 } + }); + } } }); + // comments are extracted separately from the AST + var comments = getComments(ast); + + return { + functions, + variables, + callExpressions, + memberExpressions, + objectProperties, + comments, + identifiers + }; + } + + function getSymbols(source) { + if (symbolDeclarations.has(source.id)) { + var _symbols = symbolDeclarations.get(source.id); + if (_symbols) { + return _symbols; + } + } + + var symbols = extractSymbols(source); symbolDeclarations.set(source.id, symbols); return symbols; } + function extendSnippet(name, expression, path, prevPath) { + var computed = path && path.node.computed; + var prevComputed = prevPath && prevPath.node.computed; + var prevArray = t.isArrayExpression(prevPath); + var array = t.isArrayExpression(path); + + if (expression === "") { + if (computed) { + return `[${name}]`; + } + return name; + } + + if (computed || array) { + if (prevComputed || prevArray) { + return `[${name}]${expression}`; + } + return `[${name}].${expression}`; + } + + if (prevComputed || prevArray) { + return `${name}${expression}`; + } + + return `${name}.${expression}`; + } + + function getMemberSnippet(node) { + var expression = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + + if (t.isMemberExpression(node)) { + var _name = node.property.name; + + return getMemberSnippet(node.object, extendSnippet(_name, expression)); + } + + if (t.isCallExpression(node)) { + return ""; + } + + if (t.isThisExpression(node)) { + return `this.${expression}`; + } + + if (t.isIdentifier(node)) { + return `${node.name}.${expression}`; + } + + return expression; + } + + function getObjectSnippet(path, prevPath) { + var expression = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; + + if (!path) { + return expression; + } + + var name = path.node.key.name; + + var extendedExpression = extendSnippet(name, expression, path, prevPath); + + var nextPrevPath = path; + var nextPath = path.parentPath && path.parentPath.parentPath; + + return getSnippet(nextPath, nextPrevPath, extendedExpression); + } + + function getArraySnippet(path, prevPath, expression) { + var index = prevPath.parentPath.key; + var extendedExpression = extendSnippet(index, expression, path, prevPath); + + var nextPrevPath = path; + var nextPath = path.parentPath && path.parentPath.parentPath; + + return getSnippet(nextPath, nextPrevPath, extendedExpression); + } + + function getSnippet(path, prevPath) { + var expression = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; + + if (t.isVariableDeclaration(path)) { + var node = path.node.declarations[0]; + var _name2 = node.id.name; + return extendSnippet(_name2, expression, path, prevPath); + } + + if (t.isVariableDeclarator(path)) { + var _node = path.node.id; + if (t.isObjectPattern(_node)) { + return expression; + } + + var _name3 = _node.name; + var prop = extendSnippet(_name3, expression, path, prevPath); + return prop; + } + + if (t.isAssignmentExpression(path)) { + var _node2 = path.node.left; + var _name4 = t.isMemberExpression(_node2) ? getMemberSnippet(_node2) : _node2.name; + + var _prop = extendSnippet(_name4, expression, path, prevPath); + return _prop; + } + + if ((0, _helpers.isFunction)(path)) { + return expression; + } + + if (t.isIdentifier(path)) { + var _node3 = path.node; + return `${_node3.name}.${expression}`; + } + + if (t.isObjectProperty(path)) { + return getObjectSnippet(path, prevPath, expression); + } + + if (t.isObjectExpression(path)) { + var parentPath = prevPath && prevPath.parentPath; + return getObjectSnippet(parentPath, prevPath, expression); + } + + if (t.isMemberExpression(path)) { + return getMemberSnippet(path.node, expression); + } + + if (t.isArrayExpression(path)) { + return getArraySnippet(path, prevPath, expression); + } + } + + function formatSymbols(source) { + var _getSymbols = getSymbols(source), + objectProperties = _getSymbols.objectProperties, + memberExpressions = _getSymbols.memberExpressions, + callExpressions = _getSymbols.callExpressions, + identifiers = _getSymbols.identifiers, + variables = _getSymbols.variables; + + function formatLocation(loc) { + if (!loc) { + return ""; + } + var start = loc.start, + end = loc.end; + + + var startLoc = `(${start.line}, ${start.column})`; + var endLoc = `(${end.line}, ${end.column})`; + return `[${startLoc}, ${endLoc}]`; + } + + function summarize(symbol) { + var loc = formatLocation(symbol.location); + var exprLoc = formatLocation(symbol.expressionLocation); + var params = symbol.parameterNames ? symbol.parameterNames.join(", ") : ""; + var expression = symbol.expression || ""; + return `${loc} ${exprLoc} ${expression} ${symbol.name} ${params}`; + } + + return ["properties", objectProperties.map(summarize).join("\n"), "member expressions", memberExpressions.map(summarize).join("\n"), "call expressions", callExpressions.map(summarize).join("\n"), "identifiers", identifiers.map(summarize).join("\n"), "variables", variables.map(summarize).join("\n")].join("\n"); + } + + function clearSymbols() { + symbolDeclarations = new Map(); + } + /***/ }, /* 1051 */ /***/ function(module, exports, __webpack_require__) { @@ -30621,39 +30912,45 @@ return /******/ (function(modules) { // webpackBootstrap return ast; } - function getAst(sourceText) { - if (ASTs.has(sourceText.id)) { - return ASTs.get(sourceText.id); + // Custom parser for parse-script-tags that adapts its input structure to + // our parser's signature + function htmlParser(_ref) { + var source = _ref.source, + line = _ref.line; + + return parse(source, { + startLine: line + }); + } + + function getAst(source) { + if (!source || !source.text) { + return {}; + } + + if (ASTs.has(source.id)) { + return ASTs.get(source.id); } var ast = {}; - if (sourceText.contentType == "text/html") { - // Custom parser for parse-script-tags that adapts its input structure to - // our parser's signature - var parser = (_ref) => { - var source = _ref.source, - line = _ref.line; - - return parse(source, { - startLine: line - }); - }; - ast = (0, _parseScriptTags2.default)(sourceText.text, parser) || {}; - } else if (sourceText.contentType == "text/javascript") { - ast = parse(sourceText.text); + if (source.contentType == "text/html") { + ast = (0, _parseScriptTags2.default)(source.text, htmlParser) || {}; + } else if (source.contentType == "text/javascript") { + ast = parse(source.text); } - ASTs.set(sourceText.id, ast); + ASTs.set(source.id, ast); return ast; } - function traverseAst(sourceText, visitor) { - var ast = getAst(sourceText); + function traverseAst(source, visitor) { + var ast = getAst(source); if ((0, _isEmpty2.default)(ast)) { return null; } (0, _babelTraverse2.default)(ast, visitor); + return ast; } /***/ }, @@ -30980,15 +31277,18 @@ return /******/ (function(modules) { // webpackBootstrap var _helpers = __webpack_require__(1052); - var _getSymbols = __webpack_require__(1050); + var _getSymbols2 = __webpack_require__(1050); - var _getSymbols2 = _interopRequireDefault(_getSymbols); + var _getSymbols3 = _interopRequireDefault(_getSymbols2); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - function findFunctions(source) { - var symbols = (0, _getSymbols2.default)(source); - return symbols.functions; + function findSymbols(source) { + var _getSymbols = (0, _getSymbols3.default)(source), + functions = _getSymbols.functions, + comments = _getSymbols.comments; + + return { functions, comments }; } /** @@ -31047,7 +31347,13 @@ return /******/ (function(modules) { // webpackBootstrap * location. */ function getOutOfScopeLocations(source, position) { - return findFunctions(source).map(getLocation).filter(loc => !(0, _helpers.containsPosition)(loc, position)).reduce(removeOverlaps, []).sort(sortByStart); + var _findSymbols = findSymbols(source), + functions = _findSymbols.functions, + comments = _findSymbols.comments; + + var commentLocations = comments.map(c => c.location); + + return functions.map(getLocation).concat(commentLocations).filter(loc => !(0, _helpers.containsPosition)(loc, position)).reduce(removeOverlaps, []).sort(sortByStart); } exports.default = getOutOfScopeLocations; diff --git a/devtools/client/debugger/new/pretty-print-worker.js b/devtools/client/debugger/new/pretty-print-worker.js index 64d4a47f3223..e4ef3763979a 100644 --- a/devtools/client/debugger/new/pretty-print-worker.js +++ b/devtools/client/debugger/new/pretty-print-worker.js @@ -5838,6 +5838,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ 900: /***/ function(module, exports, __webpack_require__) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + const networkRequest = __webpack_require__(901); const workerUtils = __webpack_require__(902); @@ -5851,6 +5855,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ 901: /***/ function(module, exports) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + function networkRequest(url, opts) { return new Promise((resolve, reject) => { const req = new XMLHttpRequest(); @@ -5860,7 +5868,7 @@ return /******/ (function(modules) { // webpackBootstrap if (req.status === 200) { resolve({ content: req.responseText }); } else { - resolve(req.statusText); + reject(req.statusText); } } }); @@ -5891,7 +5899,9 @@ return /******/ (function(modules) { // webpackBootstrap function WorkerDispatcher() { this.msgId = 1; this.worker = null; - } + } /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ WorkerDispatcher.prototype = { start(url) { @@ -5922,7 +5932,6 @@ return /******/ (function(modules) { // webpackBootstrap } this.worker.removeEventListener("message", listener); - if (result.error) { reject(result.error); } else { diff --git a/devtools/client/debugger/new/search-worker.js b/devtools/client/debugger/new/search-worker.js index 1a7627038d99..76af46c55898 100644 --- a/devtools/client/debugger/new/search-worker.js +++ b/devtools/client/debugger/new/search-worker.js @@ -472,6 +472,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ 900: /***/ function(module, exports, __webpack_require__) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + const networkRequest = __webpack_require__(901); const workerUtils = __webpack_require__(902); @@ -485,6 +489,10 @@ return /******/ (function(modules) { // webpackBootstrap /***/ 901: /***/ function(module, exports) { + /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + function networkRequest(url, opts) { return new Promise((resolve, reject) => { const req = new XMLHttpRequest(); @@ -494,7 +502,7 @@ return /******/ (function(modules) { // webpackBootstrap if (req.status === 200) { resolve({ content: req.responseText }); } else { - resolve(req.statusText); + reject(req.statusText); } } }); @@ -525,7 +533,9 @@ return /******/ (function(modules) { // webpackBootstrap function WorkerDispatcher() { this.msgId = 1; this.worker = null; - } + } /* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ WorkerDispatcher.prototype = { start(url) { @@ -556,7 +566,6 @@ return /******/ (function(modules) { // webpackBootstrap } this.worker.removeEventListener("message", listener); - if (result.error) { reject(result.error); } else { @@ -589,7 +598,31 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/***/ 1116: +/***/ 1123: +/***/ function(module, exports, __webpack_require__) { + + "use strict"; + + var _getMatches = __webpack_require__(1173); + + var _getMatches2 = _interopRequireDefault(_getMatches); + + var _projectSearch = __webpack_require__(1140); + + var _projectSearch2 = _interopRequireDefault(_projectSearch); + + var _devtoolsUtils = __webpack_require__(900); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var workerHandler = _devtoolsUtils.workerUtils.workerHandler; + + + self.onmessage = workerHandler({ getMatches: _getMatches2.default, searchSources: _projectSearch2.default }); + +/***/ }, + +/***/ 1138: /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -676,7 +709,65 @@ return /******/ (function(modules) { // webpackBootstrap /***/ }, -/***/ 1123: +/***/ 1140: +/***/ function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.searchSource = searchSource; + exports.default = searchSources; + + 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); } } + + // Maybe reuse file search's functions? + function searchSource(source, queryText) { + var _ref; + + var text = source.text, + loading = source.loading; + + if (loading || !text || queryText == "") { + return []; + } + + var lines = text.split("\n"); + var result = undefined; + var query = new RegExp(queryText, "g"); + + var matches = lines.map((_text, line) => { + var indices = []; + + while (result = query.exec(_text)) { + indices.push({ + line: line + 1, + column: result.index, + match: result[0], + value: _text, + text: result.input + }); + } + return indices; + }).filter(_matches => _matches.length > 0); + + matches = (_ref = []).concat.apply(_ref, _toConsumableArray(matches)); + return matches; + } + + function searchSources(query, sources) { + var validSources = sources.valueSeq().filter(s => s.has("text")).toJS(); + return validSources.map(source => ({ + source, + filepath: source.url, + matches: searchSource(source, query) + })); + } + +/***/ }, + +/***/ 1173: /***/ function(module, exports, __webpack_require__) { "use strict"; @@ -684,27 +775,29 @@ return /******/ (function(modules) { // webpackBootstrap Object.defineProperty(exports, "__esModule", { value: true }); - exports.countMatches = countMatches; + exports.default = getMatches; - var _buildQuery = __webpack_require__(1116); + var _buildQuery = __webpack_require__(1138); var _buildQuery2 = _interopRequireDefault(_buildQuery); - var _devtoolsUtils = __webpack_require__(900); - function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - var workerHandler = _devtoolsUtils.workerUtils.workerHandler; - function countMatches(query, text, modifiers) { + function getMatches(query, text, modifiers) { var regexQuery = (0, _buildQuery2.default)(query, modifiers, { isGlobal: true }); - var match = text.match(regexQuery); - return match ? match.length : 0; + var matchedLocations = []; + var lines = text.split("\n"); + for (var i = 0; i < lines.length; i++) { + var singleMatch = void 0; + while ((singleMatch = regexQuery.exec(lines[i])) !== null) { + matchedLocations.push({ line: i, ch: singleMatch.index }); + } + } + return matchedLocations; } - self.onmessage = workerHandler({ countMatches }); - /***/ } /******/ }) diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking-from-console.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking-from-console.js index 8005b518d6ee..fda0e7db00c9 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking-from-console.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breaking-from-console.js @@ -5,7 +5,11 @@ // initializes and it properly highlights the right location in the // debugger. -add_task(function* () { +async function waitOnToolbox(toolbox, event) { + return new Promise(resolve => toolbox.on(event, resolve)); +} + +add_task(function*() { const url = EXAMPLE_URL + "doc-script-switching.html"; const toolbox = yield openNewTabAndToolbox(url, "webconsole"); @@ -14,9 +18,7 @@ add_task(function* () { jsterm.execute("debugger"); // Wait for the debugger to be selected and make sure it's paused - yield new Promise((resolve) => { - toolbox.on("jsdebugger-selected", resolve); - }); + yield waitOnToolbox(toolbox, "jsdebugger-selected"); is(toolbox.threadClient.state, "paused"); // Create a dbg context diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js index 21782272f505..fd5326d2eb29 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-cond.js @@ -46,6 +46,8 @@ add_task(function*() { clickElement(dbg, "gutter", 5); yield waitForDispatch(dbg, "ADD_BREAKPOINT"); yield setConditionalBreakpoint(dbg, 5, "1"); + yield waitForDispatch(dbg, "SET_BREAKPOINT_CONDITION"); + bp = findBreakpoint(dbg, "simple2", 5); is(bp.condition, "1", "breakpoint is created with the condition"); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js index bea952967198..5c1fb18e8cbc 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints-reloading.js @@ -34,6 +34,7 @@ add_task(function*() { yield reload(dbg, "simple1"); yield waitForSelectedSource(dbg); + yield waitForDispatch(dbg, "SYNC_BREAKPOINT", 2); assertEditorBreakpoint(dbg, 4); assertEditorBreakpoint(dbg, 5); }); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints.js index 11bf7263b378..686a5a1c3694 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-breakpoints.js @@ -29,11 +29,18 @@ function enableBreakpoint(dbg, index) { }); } -function toggleBreakpoints(dbg) { - return Task.spawn(function*() { - clickElement(dbg, "toggleBreakpoints"); - yield waitForDispatch(dbg, "TOGGLE_BREAKPOINTS"); - }); +function toggleBreakpoints(dbg, count) { + clickElement(dbg, "toggleBreakpoints"); +} + +function disableBreakpoints(dbg, count) { + toggleBreakpoints(dbg); + return waitForDispatch(dbg, "DISABLE_BREAKPOINT", count); +} + +function enableBreakpoints(dbg, count) { + toggleBreakpoints(dbg); + return waitForDispatch(dbg, "ENABLE_BREAKPOINT", count); } function findBreakpoint(dbg, url, line) { @@ -79,14 +86,14 @@ add_task(function*() { yield addBreakpoint(dbg, "simple2", 5); // Disable all of the breakpoints - yield toggleBreakpoints(dbg); + yield disableBreakpoints(dbg, 2); let bp1 = findBreakpoint(dbg, "simple2", 3); let bp2 = findBreakpoint(dbg, "simple2", 5); is(bp1.disabled, true, "first breakpoint is disabled"); is(bp2.disabled, true, "second breakpoint is disabled"); // Enable all of the breakpoints - yield toggleBreakpoints(dbg); + yield enableBreakpoints(dbg, 2); bp1 = findBreakpoint(dbg, "simple2", 3); bp2 = findBreakpoint(dbg, "simple2", 5); is(bp1.disabled, false, "first breakpoint is enabled"); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js index 8b954f899fd6..5351610127ef 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-editor-select.js @@ -11,7 +11,7 @@ function isElementVisible(dbg, elementName) { return bpLine && isVisibleWithin(cm, bpLine); } -add_task(function* () { +add_task(function*() { // This test runs too slowly on linux debug. I'd like to figure out // which is the slowest part of this and make it run faster, but to // fix a frequent failure allow a longer timeout. diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps.js index c3d51d853771..35d75b8e36ee 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps.js @@ -4,6 +4,35 @@ // Tests loading sourcemapped sources, setting breakpoints, and // stepping in them. +function assertBreakpointExists(dbg, source, line) { + const { selectors: { getBreakpoint }, getState } = dbg; + + ok( + getBreakpoint(getState(), { sourceId: source.id, line }), + "Breakpoint has correct line" + ); +} + +function assertEditorBreakpoint(dbg, line, shouldExist) { + const exists = !!getLineEl(dbg, line).querySelector(".new-breakpoint"); + ok( + exists === shouldExist, + "Breakpoint " + + (shouldExist ? "exists" : "does not exist") + + " on line " + + line + ); +} + +function getLineEl(dbg, line) { + const lines = dbg.win.document.querySelectorAll(".CodeMirror-code > div"); + return lines[line - 1]; +} + +function clickGutter(dbg, line) { + clickElement(dbg, "gutter", line); +} + add_task(function*() { // NOTE: the CORS call makes the test run times inconsistent requestLongerTimeout(2); @@ -13,6 +42,18 @@ add_task(function*() { yield waitForSources(dbg, "entry.js", "output.js", "times2.js", "opts.js"); ok(true, "Original sources exist"); + const bundleSrc = findSource(dbg, "bundle.js"); + + yield selectSource(dbg, bundleSrc); + + yield clickGutter(dbg, 13); + yield waitForDispatch(dbg, "ADD_BREAKPOINT"); + assertEditorBreakpoint(dbg, 13, true); + + yield clickGutter(dbg, 13); + yield waitForDispatch(dbg, "REMOVE_BREAKPOINT"); + is(getBreakpoints(getState()).size, 0, "No breakpoints exists"); + const entrySrc = findSource(dbg, "entry.js"); yield selectSource(dbg, entrySrc); @@ -25,18 +66,12 @@ add_task(function*() { // should not move anywhere. yield addBreakpoint(dbg, entrySrc, 13); is(getBreakpoints(getState()).size, 1, "One breakpoint exists"); - ok( - getBreakpoint(getState(), { sourceId: entrySrc.id, line: 13 }), - "Breakpoint has correct line" - ); + assertBreakpointExists(dbg, entrySrc, 13); // Test breaking on a breakpoint yield addBreakpoint(dbg, "entry.js", 15); is(getBreakpoints(getState()).size, 2, "Two breakpoints exist"); - ok( - getBreakpoint(getState(), { sourceId: entrySrc.id, line: 15 }), - "Breakpoint has correct line" - ); + assertBreakpointExists(dbg, entrySrc, 15); invokeInTab("keepMeAlive"); yield waitForPaused(dbg); diff --git a/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps2.js b/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps2.js index 0d3b6666b30b..0a3a061afa7c 100644 --- a/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps2.js +++ b/devtools/client/debugger/new/test/mochitest/browser_dbg-sourcemaps2.js @@ -24,7 +24,7 @@ add_task(function*() { yield addBreakpoint(dbg, mainSrc, 4); is(getBreakpoints(getState()).size, 1, "One breakpoint exists"); ok( - getBreakpoint(getState(), { sourceId: mainSrc.id, line: 4 }), + getBreakpoint(getState(), { sourceId: mainSrc.id, line: 4, column: 2 }), "Breakpoint has correct line" ); diff --git a/devtools/client/locales/en-US/debugger.properties b/devtools/client/locales/en-US/debugger.properties index 95a3698cd17a..690ebb515217 100644 --- a/devtools/client/locales/en-US/debugger.properties +++ b/devtools/client/locales/en-US/debugger.properties @@ -136,6 +136,10 @@ sources.search.key2=CmdOrCtrl+P # search for searching all the source files the debugger has seen. sources.search.alt.key=CmdOrCtrl+O +# LOCALIZATION NOTE (projectTextSearch.key): A key shortcut to open the +# full project text search for searching all the files the debugger has seen. +projectTextSearch.key=CmdOrCtrl+Shift+F + # LOCALIZATION NOTE (sources.noSourcesAvailable): Text shown when the debugger # does not have any sources. sources.noSourcesAvailable=This page has no sources diff --git a/devtools/client/preferences/debugger.js b/devtools/client/preferences/debugger.js index 399c57c56a6b..e186ba4e7398 100644 --- a/devtools/client/preferences/debugger.js +++ b/devtools/client/preferences/debugger.js @@ -37,5 +37,5 @@ pref("devtools.debugger.pending-selected-location", "{}"); pref("devtools.debugger.pending-breakpoints", "{}"); pref("devtools.debugger.expressions", "[]"); pref("devtools.debugger.file-search-case-sensitive", false); -pref("devtools.debugger.file-search-whole-word", false ); +pref("devtools.debugger.file-search-whole-word", false); pref("devtools.debugger.file-search-regex-match", false);