Power Automate - Show Complete Expressions

Extends the Power Automate editor so that full expressions are displayed instead of including ...

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey, Greasemonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey किंवा Violentmonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला Tampermonkey यासारखे एक्स्टेंशन इंस्टॉल करावे लागेल..

ही स्क्रिप्ट इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्क्रिप्ट व्यवस्थापक एक्स्टेंशन इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्क्रिप्ट व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला Stylus सारखे एक्स्टेंशन इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

ही स्टाईल इंस्टॉल करण्यासाठी तुम्हाला एक युझर स्टाईल व्यवस्थापक इंस्टॉल करावे लागेल.

(माझ्याकडे आधीच युझर स्टाईल व्यवस्थापक आहे, मला इंस्टॉल करू द्या!)

// ==UserScript==
// @name         Power Automate - Show Complete Expressions
// @namespace    http://www.rnwood.co.uk/
// @version      0.2
// @description  Extends the Power Automate editor so that full expressions are displayed instead of including ...
// @author       [email protected]
// @match        https://make.powerautomate.com/environments/*/flows/*
// @match        https://make.powerautomate.com/environments/*/solutions/*/flows/*
// @match        https://make.powerautomate.com/*/widgets/manage/environments/*/flows/*
// @match        https://make.powerautomate.com/*/widgets/manage/environments/*/solutions/*/flows/*
// @icon         https://www.google.com/s2/favicons?sz=64&domain=powerautomate.com
// @license      MIT
// @grant GM_addStyle
// ==/UserScript==

(function() {
    'use strict';

    const EXPRESSIONSELECTOR = `span.msla-editor-input-token-wrapper span.msla-editor-input-token span span[data-text="true"]`;

    GM_addStyle ( EXPRESSIONSELECTOR + ` {
              max-width: none !important;
              font-family: monospace !important;
              white-space: normal !important;
              overflow-wrap: anywhere !important;
          }
    `);

    function processElement(elem) {
        debugger;
        elem.innerText = elem.parentNode.parentNode.title;
        new MutationObserver((mutationRecords) => {
            elem.innerText = elem.parentNode.parentNode.title;
        }).observe(elem.parentNode.parentNode, {attributes: true, attributeFilter:['title'] });

        elem.parentNode.parentNode.style.display = "inline-block;";
        elem.parentNode.parentNode.style.height = "fit-content";
        elem.parentNode.style.height = "fit-content";
    }

    const observer = new MutationObserver((mutationRecords) => {
        for(const mutationRecord of mutationRecords) {
            for(const addedNode of mutationRecord.addedNodes) {
                if (addedNode.nodeType == Node.ELEMENT_NODE) {
                    if (addedNode.matches(EXPRESSIONSELECTOR)) {
                        processElement(addedNode);
                    }
                    for(var elem of addedNode.querySelectorAll(EXPRESSIONSELECTOR)) {
                        processElement(elem);
                    }
                }
            }
        }
    });

    observer.observe(document, { childList: true, subtree: true });

    for(const elem of document.querySelectorAll(EXPRESSIONSELECTOR)) {
        processElement(elem);
    }
})();