Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 0 additions & 90 deletions packages/block-editor/src/components/duotone/utils.js

This file was deleted.

14 changes: 8 additions & 6 deletions packages/block-editor/src/hooks/duotone.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ import { useInstanceId } from '@wordpress/compose';
import { addFilter } from '@wordpress/hooks';
import { useMemo, useEffect } from '@wordpress/element';
import { useSelect } from '@wordpress/data';
import { getBlockSelector } from '@wordpress/global-styles-engine';
import {
getBlockSelector,
privateApis as globalStylesEnginePrivateApis,
} from '@wordpress/global-styles-engine';

/**
* Internal dependencies
Expand All @@ -27,23 +30,22 @@ import {
__experimentalDuotoneControl as DuotoneControl,
useSettings,
} from '../components';
import {
getDuotoneFilter,
getDuotoneStylesheet,
getDuotoneUnsetStylesheet,
} from '../components/duotone/utils';
import { scopeSelector } from '../components/global-styles/utils';
import {
cleanEmptyObject,
useBlockSettings,
usePrivateStyleOverride,
} from './utils';
import { unlock } from '../lock-unlock';
import { default as StylesFiltersPanel } from '../components/global-styles/filters-panel';
import { useResolvedStyle } from '../components/global-styles/inherited-value-context';
import { useBlockEditingMode } from '../components/block-editing-mode';
import { useBlockElement } from '../components/block-list/use-block-props/use-block-refs';
import { store as blockEditorStore } from '../store';

const { getDuotoneFilter, getDuotoneStylesheet, getDuotoneUnsetStylesheet } =
unlock( globalStylesEnginePrivateApis );

const EMPTY_ARRAY = [];

// Safari does not always update the duotone filter when the duotone colors
Expand Down
10 changes: 8 additions & 2 deletions packages/block-editor/src/private-apis.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
/**
* WordPress dependencies
*/
import { privateApis as globalStylesEnginePrivateApis } from '@wordpress/global-styles-engine';

/**
* Internal dependencies
*/
import * as globalStyles from './components/global-styles';
import { ExperimentalBlockEditorProvider } from './components/provider';
import { lock } from './lock-unlock';
import { lock, unlock } from './lock-unlock';
import { getRichTextValues } from './components/rich-text/get-rich-text-values';
import ResizableBoxPopover from './components/resizable-box-popover';
import { default as PrivateQuickInserter } from './components/inserter/quick-inserter';
Expand Down Expand Up @@ -40,7 +45,6 @@ import {
ExperimentalBlockCanvas,
BlockCanvasCover,
} from './components/block-canvas';
import { getDuotoneFilter } from './components/duotone/utils';
import { useFlashEditableBlocks } from './components/use-flash-editable-blocks';
import {
selectBlockPatternsKey,
Expand Down Expand Up @@ -84,6 +88,8 @@ import {
isRelativePath,
} from './components/link-control/is-url-like';

const { getDuotoneFilter } = unlock( globalStylesEnginePrivateApis );

/**
* Private @wordpress/block-editor APIs.
*/
Expand Down
8 changes: 8 additions & 0 deletions packages/global-styles-engine/src/private-apis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import {
getViewportBreakpoints,
getViewportBreakpointValueInPixels,
} from './utils/viewport';
import {
getDuotoneFilter,
getDuotoneStylesheet,
getDuotoneUnsetStylesheet,
} from './utils/duotone';
import { resolveStyle } from './resolve-style';
import { getVariationStyle } from './variation';
import { lock } from './lock-unlock';
Expand All @@ -15,6 +20,9 @@ lock( privateApis, {
getResponsiveMediaQueries,
getViewportBreakpoints,
getViewportBreakpointValueInPixels,
getDuotoneFilter,
getDuotoneStylesheet,
getDuotoneUnsetStylesheet,
resolveStyle,
getVariationStyle,
} );
Loading