Skip to content

Commit

Permalink
Code: Moved layer panel to proper folder structure (#12065)
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Barklund committed Aug 3, 2022
1 parent e034e08 commit 2da2aaf
Show file tree
Hide file tree
Showing 16 changed files with 31 additions and 31 deletions.
4 changes: 2 additions & 2 deletions packages/story-editor/src/components/footer/layers/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import styled from 'styled-components';
import { useState, useRef, useEffect } from '@googleforcreators/react';
import { __, sprintf } from '@googleforcreators/i18n';
import { PLACEMENT } from '@googleforcreators/design-system';

/**
* Internal dependencies
*/
import { Z_INDEX_FOOTER } from '../../../constants/zIndex';
import { LayerPanel } from '../../panels/design';
import useLayers from '../../panels/design/layer/useLayers';
import { LayerPanel, useLayers } from '../../panels/layer';
import Popup, { NavigationWrapper } from '../../secondaryPopup';
import { ToggleButton } from '../../toggleButton';
import { useCanvas } from '../../../app';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export { default as CaptionsPanel } from './captions';
export { default as ElementAlignmentPanel } from './alignment';
export { default as FilterPanel } from './filter';
export { default as ImageAccessibilityPanel } from './imageAccessibility';
export { default as LayerPanel } from './layer';
export { default as LinkPanel } from './link';
export { default as PageAttachmentPanel } from './pageAttachment';
export { default as PageBackgroundPanel } from './pageBackground';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ import { useFeature } from 'flagged';
*/
import PropTypes from 'prop-types';
import { v4 as uuidv4 } from 'uuid';
import { useCanvas, useStory } from '../../../../app';
import Tooltip from '../../../tooltip';
import generateGroupName from '../../../../utils/generateGroupName';
import { useCanvas, useStory } from '../../../app';
import Tooltip from '../../tooltip';
import generateGroupName from '../../../utils/generateGroupName';
import { LAYER_HEIGHT, NESTED_PX } from './constants';
import useGroupSelection from './useGroupSelection';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
* limitations under the License.
*/

export { default } from './layerPanel';
export { default as LayerPanel } from './layerPanel';
export { default as useLayers } from './useLayers';
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { TEXT_ELEMENT_DEFAULT_FONT } from '@googleforcreators/elements';
/**
* Internal dependencies
*/
import { Fixture } from '../../../../../karma';
import { useInsertElement } from '../../../../canvas';
import { useStory } from '../../../../../app/story';
import { Fixture } from '../../../../karma';
import { useInsertElement } from '../../../canvas';
import { useStory } from '../../../../app/story';

describe('Layer Panel', () => {
let fixture;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ import { useFeature } from 'flagged';
/**
* Internal dependencies
*/
import StoryPropTypes from '../../../../types';
import { useStory, useCanvas } from '../../../../app';
import useCORSProxy from '../../../../utils/useCORSProxy';
import usePerformanceTracking from '../../../../utils/usePerformanceTracking';
import { TRACKING_EVENTS } from '../../../../constants';
import Tooltip from '../../../tooltip';
import useShapeMask from '../../../../utils/useShapeMask';
import StoryPropTypes from '../../../types';
import { useStory, useCanvas } from '../../../app';
import useCORSProxy from '../../../utils/useCORSProxy';
import usePerformanceTracking from '../../../utils/usePerformanceTracking';
import { TRACKING_EVENTS } from '../../../constants';
import Tooltip from '../../tooltip';
import useShapeMask from '../../../utils/useShapeMask';
import useLayerSelection from './useLayerSelection';
import ShapeMaskWrapper from './shapeMaskWrapper';
import { LAYER_HEIGHT, NESTED_PX } from './constants';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ import {
Reorderable,
ReorderableSeparator,
ReorderableItem,
} from '../../../reorderable';
import { useRightClickMenu, useStory, useCanvas } from '../../../../app';
import useFocusCanvas from '../../../canvas/useFocusCanvas';
} from '../../reorderable';
import { useRightClickMenu, useStory, useCanvas } from '../../../app';
import useFocusCanvas from '../../canvas/useFocusCanvas';
import { LAYER_HEIGHT } from './constants';
import Layer from './layer';
import ReorderableGroup from './reorderableGroup';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import styled from 'styled-components';
/**
* Internal dependencies
*/
import { PanelContent } from '../../panel';
import useSidebar from '../../../sidebar/useSidebar';
import { PanelContent } from '../panel';
import useSidebar from '../../sidebar/useSidebar';
import LayerList from './layerList';
import useLayers from './useLayers';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import PropTypes from 'prop-types';
/**
* Internal dependencies
*/
import { ReorderableSeparator, ReorderableItem } from '../../../reorderable';
import { ReorderableSeparator, ReorderableItem } from '../../reorderable';
import { LAYER_HEIGHT } from './constants';
import Group from './group';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import { generateMaskId } from '@googleforcreators/masks';
/**
* Internal dependencies
*/
import useShapeMask from '../../../../utils/useShapeMask';
import StoryPropTypes from '../../../../types';
import useShapeMask from '../../../utils/useShapeMask';
import StoryPropTypes from '../../../types';

const MaskedIconWrapper = styled.div`
position: relative;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useCallback } from '@googleforcreators/react';
/**
* Internal dependencies
*/
import { useStory, useCanvas } from '../../../../app';
import { useStory, useCanvas } from '../../../app';

function useGroupSelection(groupId) {
const { toggleLayer, groupLayers, selectedElementIds } = useStory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { useCallback } from '@googleforcreators/react';
/**
* Internal dependencies
*/
import { useStory, useCanvas } from '../../../../app';
import { useStory, useCanvas } from '../../../app';

function useLayerSelection(layer) {
const { id: elementId } = layer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
/**
* Internal dependencies
*/
import { useStory } from '../../../../app';
import { STABLE_ARRAY } from '../../../../constants';
import { useStory } from '../../../app';
import { STABLE_ARRAY } from '../../../constants';

function useLayers() {
const elements = useStory(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { useCallback, useRef, useState } from '@googleforcreators/react';
/**
* Internal dependencies
*/
import { NESTED_PX } from '../panels/design/layer/constants';
import { NESTED_PX } from '../panels/layer/constants';
import useReorderable from './useReorderable';

const Wrapper = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const includeDefaultScrimBackground = [
* Element and page thumbnails, used in the prepublish checklist
*
* @param {Object} props Component props.
* @param {Node} props.displayBackground Node that renders the element. Relies on PagePreview or LayerIcon (getDefinitionForType, see panels/design/layer) to keep element rendering consistent with carousel and layer panels. See /storybook for demo.
* @param {Node} props.displayBackground Node that renders the element. Relies on PagePreview or LayerIcon (getDefinitionForType, see panels/layer) to keep element rendering consistent with carousel and layer panels. See /storybook for demo.
* @param {boolean} props.isError Thumbnail errors don't prevent further interaction with the thumbnail, they just change the presentation so user knows the action failed.
* @param {boolean} props.isLoading If a thumbnail needs to show a loading progress bar this should be true.
* @param {string} props.loadingMessage If a thumbnail needs an aria alert with loading bar this should be used.
Expand Down

0 comments on commit 2da2aaf

Please sign in to comment.