Home / File/ setupNativeStyleEditor.js — react Source File

setupNativeStyleEditor.js — react Source File

Architecture documentation for setupNativeStyleEditor.js, a javascript file in the react codebase. 7 imports, 0 dependents.

File javascript BabelCompiler Validation 7 imports 1 functions

Entity Profile

Dependency Diagram

graph LR
  000d0fc2_7992_5e09_af69_667403fcc410["setupNativeStyleEditor.js"]
  895b64ec_6219_126e_b7be_a2d6f2c8d780["resolveBoxStyle.js"]
  000d0fc2_7992_5e09_af69_667403fcc410 --> 895b64ec_6219_126e_b7be_a2d6f2c8d780
  9b82aa86_a9e2_3c74_3fdc_eec03afed36b["resolveBoxStyle"]
  000d0fc2_7992_5e09_af69_667403fcc410 --> 9b82aa86_a9e2_3c74_3fdc_eec03afed36b
  0304bbc8_f110_6643_71c6_d26bddc58fde["types.js"]
  000d0fc2_7992_5e09_af69_667403fcc410 --> 0304bbc8_f110_6643_71c6_d26bddc58fde
  a20e28a6_49e7_d981_96eb_f6f2ef1589af["types.js"]
  000d0fc2_7992_5e09_af69_667403fcc410 --> a20e28a6_49e7_d981_96eb_f6f2ef1589af
  7812cbae_0bd0_497c_0a05_31fe0a8d0fde["agent"]
  000d0fc2_7992_5e09_af69_667403fcc410 --> 7812cbae_0bd0_497c_0a05_31fe0a8d0fde
  7a7a2c85_2337_a4ad_6883_71d2c6b4b916["isArray"]
  000d0fc2_7992_5e09_af69_667403fcc410 --> 7a7a2c85_2337_a4ad_6883_71d2c6b4b916
  4077b620_5c59_61c2_0910_273f565da757["bridge"]
  000d0fc2_7992_5e09_af69_667403fcc410 --> 4077b620_5c59_61c2_0910_273f565da757
  style 000d0fc2_7992_5e09_af69_667403fcc410 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 Agent from 'react-devtools-shared/src/backend/agent';
import resolveBoxStyle from './resolveBoxStyle';
import isArray from 'react-devtools-shared/src/isArray';

import type {BackendBridge} from 'react-devtools-shared/src/bridge';
import type {RendererID} from '../types';
import type {StyleAndLayout} from './types';

export type ResolveNativeStyle = (stylesheetID: any) => ?Object;
export type SetupNativeStyleEditor = typeof setupNativeStyleEditor;

export default function setupNativeStyleEditor(
  bridge: BackendBridge,
  agent: Agent,
  resolveNativeStyle: ResolveNativeStyle,
  validAttributes?: $ReadOnlyArray<string> | null,
) {
  bridge.addListener(
    'NativeStyleEditor_measure',
    ({id, rendererID}: {id: number, rendererID: RendererID}) => {
      measureStyle(agent, bridge, resolveNativeStyle, id, rendererID);
    },
  );

  bridge.addListener(
    'NativeStyleEditor_renameAttribute',
    ({
      id,
      rendererID,
      oldName,
      newName,
      value,
    }: {
      id: number,
      rendererID: RendererID,
      oldName: string,
      newName: string,
      value: string,
    }) => {
      renameStyle(agent, id, rendererID, oldName, newName, value);
      setTimeout(() =>
        measureStyle(agent, bridge, resolveNativeStyle, id, rendererID),
      );
    },
  );

  bridge.addListener(
    'NativeStyleEditor_setValue',
    ({
      id,
      rendererID,
// ... (268 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does setupNativeStyleEditor.js do?
setupNativeStyleEditor.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 setupNativeStyleEditor.js?
setupNativeStyleEditor.js defines 1 function(s): ResolveNativeStyle.
What does setupNativeStyleEditor.js depend on?
setupNativeStyleEditor.js imports 7 module(s): agent, bridge, isArray, resolveBoxStyle, resolveBoxStyle.js, types.js, types.js.
Where is setupNativeStyleEditor.js in the architecture?
setupNativeStyleEditor.js is located at packages/react-devtools-shared/src/backend/NativeStyleEditor/setupNativeStyleEditor.js (domain: BabelCompiler, subdomain: Validation, directory: packages/react-devtools-shared/src/backend/NativeStyleEditor).

Analyze Your Own Codebase

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

Try Supermodel Free