
META-INF.resources.js.ddm_template_editor.components.App.js Maven / Gradle / Ivy
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React, {useState} from 'react';
import {AppContextProvider} from './AppContext';
import {ClosableAlert} from './ClosableAlert';
import {Editor} from './Editor';
import Sidebar from './Sidebar';
import {PANEL_IDS} from './panelIds';
import './App.scss';
export default function App({
editorAutocompleteData = {variables: {}},
mode = 'text/plain',
portletNamespace,
propertiesViewURL,
script: initialScript = '',
showCacheableWarning = false,
showTemplateWarning = false,
showPropertiesPanel = false,
templateVariableGroups = [],
}) {
const [selectedSidebarPanelId, setSelectedSidebarPanelId] = useState(
showPropertiesPanel ? PANEL_IDS.properties : PANEL_IDS.elements
);
return (
);
}
App.propTypes = {
editorAutocompleteData: PropTypes.object.isRequired,
mode: PropTypes.oneOfType([
PropTypes.string,
PropTypes.shape({
globalVars: PropTypes.bool.isRequired,
name: PropTypes.string.isRequired,
}),
]),
portletNamespace: PropTypes.string.isRequired,
script: PropTypes.string.isRequired,
showCacheableWarning: PropTypes.bool.isRequired,
templateVariableGroups: PropTypes.any.isRequired,
};
© 2015 - 2025 Weber Informatics LLC | Privacy Policy