diff --git a/plugin/assets/src/block-editor/blocks/tab-bar/deprecated.js b/plugin/assets/src/block-editor/blocks/tab-bar/deprecated.js new file mode 100644 index 00000000..dafb84fc --- /dev/null +++ b/plugin/assets/src/block-editor/blocks/tab-bar/deprecated.js @@ -0,0 +1,24 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Internal dependencies + */ +import { SaveM2 } from './deprecated/m2/m2-tab-save'; + +const deprecated = [ SaveM2 ]; + +export default deprecated; diff --git a/plugin/assets/src/block-editor/blocks/tab-bar/deprecated/m2/m2-tab-save.js b/plugin/assets/src/block-editor/blocks/tab-bar/deprecated/m2/m2-tab-save.js new file mode 100644 index 00000000..df12f57a --- /dev/null +++ b/plugin/assets/src/block-editor/blocks/tab-bar/deprecated/m2/m2-tab-save.js @@ -0,0 +1,102 @@ +/* + * Copyright 2022 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +/** + * External dependencies + */ +import classNames from 'classnames'; + +/** + * Internal dependencies + */ +import { Tab } from '../../components/tab'; + +/** + * WordPress dependencies + */ +import { RawHTML } from '@wordpress/element'; +import { getBlockContent } from '@wordpress/blocks'; +import { useBlockProps } from '@wordpress/block-editor'; + +const attributesM2 = { + forceUpdate: { + type: 'boolean', + default: true, + }, + iconPosition: { + type: 'string', + default: 'none', + }, + tabs: { + type: 'array', + default: [], + }, + preview: { + type: 'boolean', + default: false, + }, +}; + +const TabBarSave = ( { attributes: { tabs, iconPosition } } ) => { + const blockProps = useBlockProps.save( { + className: 'mdc-tab-bar-container', + } ); + return ( +