A React HOC that returns a component that the user can mutate.
@param {React} Component is the component we will mutate
@param {String} title is the name you want to associate with the mutation
184420
function mutate(Component, title, api = {}) {
  class Mutated extends React.Component {
    constructor(props, context) {
      super(props);

      this.ToRender = Component;
      const mutations = context.mutations;

      if (!mutations || !mutations[title]) {
        return;
      }

      // Convert old style mutations to new style mutations
      if (!Array.isArray(mutations[title])) {
        mutations[title] = [mutations[title]];
      }

      // Apply all mutations to the component
      for (let mut of mutations[title]) {
        this.ToRender = mut(this.ToRender, api);
      }
    }

    render() {
      const ToRender = this.ToRender;
      return <ToRender {...this.props} />;
    }
  }

  Mutated.contextTypes = {
    mutations: PropTypes.object
  };

  return Mutated;
}
854561
function TextBlock(props) {
  return _react2.default.createElement(
    'div',
    { className: props.className, onClick: props.onClick },
    props.text || ''
  );
}
1276804
function createInternalComponent(element) {
  !genericComponentClass ?  false ? invariant(false, 'There is no registered component for the tag %s', element.type) : _prodInvariant('111', element.type) : void 0;
  return new genericComponentClass(element);
}
672132
function genComponent (
  componentName,
  el,
  state
) {
  const children = el.inlineTemplate ? null : genChildren(el, state, true)
  return `_c(${componentName},${genData(el, state)}${
    children ? `,${children}` : ''
  })`
}
1150663
function configureComponent(configPath, component, componentPath) {
    let config;
    try {
        config = require(configPath);

        // If this is the default variant
        if (!component.variant) {
            config.title = component.name;
            config.status = component.status;
            config.context = config.context || {};
            config.context.type = component.type;
        }

        config.variants = config.variants || [];
    } catch (e) {
        config = {
            title: component.name,
            status: component.status,
            context: {
                type: component.type,
            },
            variants: [],
        };
    }

    // Register the preview component
    if (component.preview) {
        config.preview = `@${[...componentPath, dashify(component.name), 'preview'].join('-')}`;
    }

    // Remove the variant if already present
    const variant = component.variant || 'default';
    config.variants = config.variants.filter(vt => vt.name !== variant);

    // Register the variant
    config.variants.push({
        name: variant,
        label: component.label || ((variant === 'default') ? component.name : variant),
        context: {
            config: component.config,
            parameters: component.parameters || {},
            request: component.request,
            component: component.class,
        },
    });

    config.variants = config.variants.sort((a, b) => {
        const aName = a.label.toLowerCase();
        const bName = b.label.toLowerCase();
        if (aName > bName) {
            return 1;
        }
        return (aName < bName) ? -1 : 0;
    });
    config.variants.forEach((v, i) => {
        config.variants[i].order = i;
    });

    // Write the configuration file
    writeFile(configPath, JSON.stringify(config, null, 4));

    // If there's a component note
    if ((variant === 'default') && component.notice) {
        const readme = path.join(path.dirname(configPath), 'README.md');
        writeFile(readme, component.notice);
    }
}
990894
function Header({
  RootComponent,
  className,
  children,
  size = 1,
}: Props): React.Node {
  const classes = cn(`h${size}`, className);
  const Component = RootComponent || "div";
  return <Component className={classes}>{children}</Component>;
}
1105386
function mutate(translate) {
      for (var i = 0; i < TRANSFORMERS.length; i++) {
        var transformer = TRANSFORMERS[i];

        if (isFunction(transformer) && isFunction(transformer().modify)) {
          translate = transformer(Glide, Components, Events).modify(translate);
        } else {
          warn('Transformer should be a function that returns an object with `modify()` method');
        }
      }

      return translate;
    }
247092
function( title ) {
		this.element.attr( 'title', lm.utils.stripTags( title ) );
		this.titleElement.html( title );
	}
1190872
public static Component createDropDown(String buttonHtml, Component content, String title) {

        PopupView pv = new PopupView(buttonHtml, content);
        pv.setDescription(title);
        pv.addStyleName(OpenCmsTheme.NAVIGATOR_DROPDOWN);
        pv.setHideOnMouseOut(false);
        return pv;
    }
751669
function( name, value ){
      var style = this.cy().style();

      if( $$.is.plainObject(name) ){ // then extend the bypass
        var props = name;
        style.applyBypass( this, props );

        var updatedCompounds = this.updateCompoundBounds();
        this.add( updatedCompounds ).rtrigger('style'); // let the renderer know we've updated style

      } else if( $$.is.string(name) ){
  
        if( value === undefined ){ // then get the property from the style
          var ele = this[0];

          if( ele ){
            return ele._private.style[ name ].strValue;
          } else { // empty collection => can't get any value
            return;
          }

        } else { // then set the bypass with the property value
          style.applyBypass( this, name, value );

          var updatedCompounds = this.updateCompoundBounds();
          this.add( updatedCompounds ).rtrigger('style'); // let the renderer know we've updated style
        }

      } else if( name === undefined ){
        var ele = this[0];

        if( ele ){
          return style.getRawStyle( ele );
        } else { // empty collection => can't get any value
          return;
        }
      }

      return this; // chaining
    }
415806
function( entireComponent ) {

                // Insert a new component holder in the root or box.
                if ( entireComponent ) P.$root.html( createWrappedComponent() )
                else P.$root.find( '.' + CLASSES.box ).html( P.component.nodes( STATE.open ) )

                // Trigger the queued “render” events.
                return P.trigger( 'render' )
            }
1283953
protected String buildTitle(final Component component) {
		Component current = component;
		final StringBuilder title = new StringBuilder();
		while (current != null) {
			final String currentTitle = getTitleIfKnownComponent(current);
			if (currentTitle != null && currentTitle.length() != 0) {
				if (title.length() != 0) {
					title.insert(0, " - ");
				}
				title.insert(0, currentTitle);
			}
			current = current.getParent();
		}

		return title.length() != 0 ? title.toString() : null;
	}
606760
function renderHtmlAst(node, { components }) {
  if (node.type === 'root') {
    // NOTE: wrap children with React.Fragment, to avoid div wrapper from `hast-to-hyperscript`
    node = {
      type: 'element',
      tagName: Fragment,
      properties: {},
      children: node.children,
    };
  }

  function h(name, props, children) {
    return React.createElement(
      getReactElement(name, components),
      props,
      getReactChildren(name, children),
    );
  }

  return toH(h, node);
}
100944
function transform (tag, props, children) {
      if (tag === '!--') {
        return createComment(props.comment)
      }

      const id = path.scope.generateUidIdentifier(getElementName(props, tag))
      path.scope.push({ id })

      const result = []

      if (tag === 'nanohtml-fragment') {
        result.push(t.assignmentExpression('=', id, createFragment()))
      } else {
        var isCustomElement = props.is
        delete props.is

        // Use the SVG namespace for svg elements.
        if (SVG_TAGS.includes(tag)) {
          state.svgNamespaceId.used = true

          if (isCustomElement) {
            result.push(t.assignmentExpression('=', id, createNsCustomBuiltIn(state.svgNamespaceId, tag, isCustomElement)))
          } else {
            result.push(t.assignmentExpression('=', id, createNsElement(state.svgNamespaceId, tag)))
          }
        } else if (isCustomElement) {
          result.push(t.assignmentExpression('=', id, createCustomBuiltIn(tag, isCustomElement)))
        } else {
          result.push(t.assignmentExpression('=', id, createElement(tag)))
        }
      }

      Object.keys(props).forEach((propName) => {
        const dynamicPropName = convertPlaceholders(propName).filter(isNotEmptyString)
        // Just use the normal propName if there are no placeholders
        if (dynamicPropName.length === 1 && t.isStringLiteral(dynamicPropName[0])) {
          propName = dynamicPropName[0].value
        } else {
          state.setAttributeId.used = true
          result.push(addDynamicAttribute(state.setAttributeId, id, dynamicPropName.reduce(concatAttribute),
            convertPlaceholders(props[propName]).filter(isNotEmptyString).reduce(concatAttribute)))
          return
        }

        // don’t convert to lowercase, since some attributes are case-sensetive
        let attrName = propName

        if (attrName === 'className') {
          attrName = 'class'
        }

        if (attrName === 'htmlFor') {
          attrName = 'for'
        }

        // abc.onclick = xyz
        if (attrName.slice(0, 2) === 'on' || DIRECT_PROPS.indexOf(attrName) > -1) {
          const value = convertPlaceholders(props[propName]).filter(isNotEmptyString)
          result.push(setDomProperty(id, attrName,
            value.length === 1
              ? value[0]
              : value.map(ensureString).reduce(concatAttribute)
          ))

          return
        }

        // Dynamic boolean attributes
        if (BOOL_PROPS.indexOf(attrName) !== -1 && props[propName] !== attrName) {
          // if (xyz) abc.setAttribute('disabled', 'disabled')
          result.push(setBooleanAttribute(id, attrName,
            convertPlaceholders(props[propName])
              .filter(isNotEmptyString)[0]))
          return
        }

        // use proper xml namespace for svg use links
        if (attrName === 'xlink:href') {
          const value = convertPlaceholders(props[propName])
            .map(ensureString)
            .reduce(concatAttribute)

          state.xlinkNamespaceId.used = true
          result.push(setDomAttributeNS(id, attrName, value, state.xlinkNamespaceId))

          return
        }

        // abc.setAttribute('class', xyz)
        result.push(setDomAttribute(id, attrName,
          convertPlaceholders(props[propName])
            .map(ensureString)
            .reduce(concatAttribute)
        ))
      })

      if (Array.isArray(children)) {
        const realChildren = children.map(convertPlaceholders)
          // Flatten
          .reduce((flat, arr) => flat.concat(arr), [])
          // Remove empty strings since they don't affect output
          .filter(isNotEmptyString)

        if (realChildren.length > 0) {
          state.appendChildId.used = true
          result.push(appendChild(state.appendChildId, id, realChildren))
        }
      }

      result.push(id)
      return t.sequenceExpression(result)
    }
474938
function (oComponent) {
			var sComponentName = "";
			if (oComponent) {
				sComponentName = oComponent.getMetadata().getName();
			}
			if (sComponentName.length > 0 && sComponentName.indexOf(".Component") < 0) {
				sComponentName += ".Component";
			}
			return sComponentName;
		}
557295
function Czosnek(title)
  {
    if(!__templates[title]) return console.error("ERR: Component "+title+" does not exist, make sure to create it", new Error().stack);
    /* Name of the component */
    this.title = title;
    
    /* Component ID */
    this.id = uuid();
    
    /* created component */
    this.component = expand(title);
    
    /* Expanded styles */
    this.style = style(title, this.id);
    
    /* Maps of component */
    this.maps = map(this.component, this.style, this.id);
    
    Object.defineProperty(this.component, '__CzosnekRoot__', setDescriptor(this));
    
    __registered__.push(this);
  }
155908
public static JPanel wrapTitled(String title, JComponent component)
    {
        JPanel p = new JPanel(new GridLayout(1,1));
        p.setBorder(BorderFactory.createTitledBorder(title));
        p.add(component);
        return p;
    }