Home / File/ InspectedElementStyleXPlugin.js — react Source File

InspectedElementStyleXPlugin.js — react Source File

Architecture documentation for InspectedElementStyleXPlugin.js, a javascript file in the react codebase. 9 imports, 1 dependents.

File javascript BabelCompiler Validation 9 imports 1 dependents 1 functions

Entity Profile

Dependency Diagram

graph LR
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535["InspectedElementStyleXPlugin.js"]
  276bc34e_3008_101e_3cd7_cc895fcd3848["KeyValue.js"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> 276bc34e_3008_101e_3cd7_cc895fcd3848
  b5067ef5_22cb_1a20_66d3_9a573b206f48["KeyValue"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> b5067ef5_22cb_1a20_66d3_9a573b206f48
  bba85af0_a356_d0c5_4d12_914508b89593["store.js"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> bba85af0_a356_d0c5_4d12_914508b89593
  2337051b_9399_908a_f16c_81724ab026b7["InspectedElementSharedStyles.css"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> 2337051b_9399_908a_f16c_81724ab026b7
  2f9f7077_d110_4be2_fd13_494fd71bc9c9["InspectedElementStyleXPlugin.css"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> 2f9f7077_d110_4be2_fd13_494fd71bc9c9
  ac587885_e294_a1e9_b13f_5e7b920fdb42["react"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> ac587885_e294_a1e9_b13f_5e7b920fdb42
  ae1017d8_c18a_3ecd_18f4_bf7a64bbd91a["react-devtools-feature-flags"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> ae1017d8_c18a_3ecd_18f4_bf7a64bbd91a
  aec7978f_0a19_ba93_de9e_ac8cf5ddc74b["types"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> aec7978f_0a19_ba93_de9e_ac8cf5ddc74b
  4077b620_5c59_61c2_0910_273f565da757["bridge"]
  9ec8fdcf_1944_ffb8_5f23_12eaf9528535 --> 4077b620_5c59_61c2_0910_273f565da757
  d09ae4bb_9ed0_3257_c11b_1c199408288d["InspectedElementView.js"]
  d09ae4bb_9ed0_3257_c11b_1c199408288d --> 9ec8fdcf_1944_ffb8_5f23_12eaf9528535
  style 9ec8fdcf_1944_ffb8_5f23_12eaf9528535 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

/**
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 *
 * @flow
 */

import * as React from 'react';
import KeyValue from './KeyValue';
import Store from '../../store';
import sharedStyles from './InspectedElementSharedStyles.css';
import styles from './InspectedElementStyleXPlugin.css';
import {enableStyleXFeatures} from 'react-devtools-feature-flags';

import type {InspectedElement} from 'react-devtools-shared/src/frontend/types';
import type {FrontendBridge} from 'react-devtools-shared/src/bridge';
import type {Element} from 'react-devtools-shared/src/frontend/types';

type Props = {
  bridge: FrontendBridge,
  element: Element,
  inspectedElement: InspectedElement,
  store: Store,
};

export default function InspectedElementStyleXPlugin({
  bridge,
  element,
  inspectedElement,
  store,
}: Props): React.Node {
  if (!enableStyleXFeatures) {
    return null;
  }

  const styleXPlugin = inspectedElement.plugins.stylex;
  if (styleXPlugin == null) {
    return null;
  }

  const {resolvedStyles, sources} = styleXPlugin;

  return (
    <div>
      <div className={sharedStyles.HeaderRow}>
        <div className={sharedStyles.Header}>stylex</div>
      </div>
      {sources.map(source => (
        <div key={source} className={styles.Source}>
          {source}
        </div>
      ))}
      {Object.entries(resolvedStyles).map(([name, value]) => (
        <KeyValue
          key={name}
          alphaSort={true}
          bridge={bridge}
          canDeletePaths={false}
          canEditValues={false}
          canRenamePaths={false}
          depth={1}
          element={element}
          hidden={false}
          inspectedElement={inspectedElement}
          name={name}
          path={[name]}
          pathRoot="stylex"
          store={store}
          value={value}
        />
      ))}
    </div>
  );
}

Domain

Subdomains

Frequently Asked Questions

What does InspectedElementStyleXPlugin.js do?
InspectedElementStyleXPlugin.js is a source file in the react codebase, written in javascript. It belongs to the BabelCompiler domain, Validation subdomain.
What functions are defined in InspectedElementStyleXPlugin.js?
InspectedElementStyleXPlugin.js defines 1 function(s): InspectedElementStyleXPlugin.
What does InspectedElementStyleXPlugin.js depend on?
InspectedElementStyleXPlugin.js imports 9 module(s): InspectedElementSharedStyles.css, InspectedElementStyleXPlugin.css, KeyValue, KeyValue.js, bridge, react, react-devtools-feature-flags, store.js, and 1 more.
What files import InspectedElementStyleXPlugin.js?
InspectedElementStyleXPlugin.js is imported by 1 file(s): InspectedElementView.js.
Where is InspectedElementStyleXPlugin.js in the architecture?
InspectedElementStyleXPlugin.js is located at packages/react-devtools-shared/src/devtools/views/Components/InspectedElementStyleXPlugin.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/devtools/views/Components).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free