summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/selectors/ui.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /devtools/client/debugger/src/selectors/ui.js
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'devtools/client/debugger/src/selectors/ui.js')
-rw-r--r--devtools/client/debugger/src/selectors/ui.js85
1 files changed, 85 insertions, 0 deletions
diff --git a/devtools/client/debugger/src/selectors/ui.js b/devtools/client/debugger/src/selectors/ui.js
new file mode 100644
index 0000000000..635a41d985
--- /dev/null
+++ b/devtools/client/debugger/src/selectors/ui.js
@@ -0,0 +1,85 @@
+/* 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/>. */
+
+import { getSelectedSource } from "./sources";
+
+export function getSelectedPrimaryPaneTab(state) {
+ return state.ui.selectedPrimaryPaneTab;
+}
+
+export function getActiveSearch(state) {
+ return state.ui.activeSearch;
+}
+
+export function getFrameworkGroupingState(state) {
+ return state.ui.frameworkGroupingOn;
+}
+
+export function getPaneCollapse(state, position) {
+ if (position == "start") {
+ return state.ui.startPanelCollapsed;
+ }
+
+ return state.ui.endPanelCollapsed;
+}
+
+export function getHighlightedLineRangeForSelectedSource(state) {
+ const selectedSource = getSelectedSource(state);
+ if (!selectedSource) {
+ return null;
+ }
+ // Only return the highlighted line range if it matches the selected source
+ const highlightedLineRange = state.ui.highlightedLineRange;
+ if (
+ highlightedLineRange &&
+ selectedSource.id == highlightedLineRange.sourceId
+ ) {
+ return highlightedLineRange;
+ }
+ return null;
+}
+
+export function getConditionalPanelLocation(state) {
+ return state.ui.conditionalPanelLocation;
+}
+
+export function getLogPointStatus(state) {
+ return state.ui.isLogPoint;
+}
+
+export function getOrientation(state) {
+ return state.ui.orientation;
+}
+
+export function getViewport(state) {
+ return state.ui.viewport;
+}
+
+export function getCursorPosition(state) {
+ return state.ui.cursorPosition;
+}
+
+export function getInlinePreview(state) {
+ return state.ui.inlinePreviewEnabled;
+}
+
+export function getEditorWrapping(state) {
+ return state.ui.editorWrappingEnabled;
+}
+
+export function getJavascriptTracingLogMethod(state) {
+ return state.ui.javascriptTracingLogMethod;
+}
+
+export function getSearchOptions(state, searchKey) {
+ return state.ui.mutableSearchOptions[searchKey];
+}
+
+export function getHideIgnoredSources(state) {
+ return state.ui.hideIgnoredSources;
+}
+
+export function isSourceMapIgnoreListEnabled(state) {
+ return state.ui.sourceMapIgnoreListEnabled;
+}