mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-15 05:37:32 +00:00
feat: remove new image actions feature flag (#7256)
This commit is contained in:
@@ -453,8 +453,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
|||||||
{
|
{
|
||||||
name: 'AI image filter',
|
name: 'AI image filter',
|
||||||
icon: ImproveWritingIcon,
|
icon: ImproveWritingIcon,
|
||||||
showWhen: (_, __, host) =>
|
showWhen: () => true,
|
||||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions'),
|
|
||||||
subItem: createImageFilterSubItem(blockActionTrackerOptions),
|
subItem: createImageFilterSubItem(blockActionTrackerOptions),
|
||||||
subItemOffset: [12, -4],
|
subItemOffset: [12, -4],
|
||||||
beta: true,
|
beta: true,
|
||||||
@@ -462,8 +461,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
|||||||
{
|
{
|
||||||
name: 'Image processing',
|
name: 'Image processing',
|
||||||
icon: AIImageIcon,
|
icon: AIImageIcon,
|
||||||
showWhen: (_, __, host) =>
|
showWhen: () => true,
|
||||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions'),
|
|
||||||
subItem: createImageProcessingSubItem(blockActionTrackerOptions),
|
subItem: createImageProcessingSubItem(blockActionTrackerOptions),
|
||||||
subItemOffset: [12, -6],
|
subItemOffset: [12, -6],
|
||||||
beta: true,
|
beta: true,
|
||||||
@@ -471,8 +469,7 @@ export function buildAIImageItemGroups(): AIItemGroupConfig[] {
|
|||||||
{
|
{
|
||||||
name: 'Generate a caption',
|
name: 'Generate a caption',
|
||||||
icon: AIPenIcon,
|
icon: AIPenIcon,
|
||||||
showWhen: (_, __, host) =>
|
showWhen: () => true,
|
||||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions'),
|
|
||||||
beta: true,
|
beta: true,
|
||||||
handler: actionToHandler(
|
handler: actionToHandler(
|
||||||
'generateCaption',
|
'generateCaption',
|
||||||
|
|||||||
@@ -526,17 +526,6 @@ export function imageOnlyShowWhen(_: unknown, __: unknown, host: EditorHost) {
|
|||||||
return selected.length === 1 && selected[0] instanceof ImageBlockModel;
|
return selected.length === 1 && selected[0] instanceof ImageBlockModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function experimentalImageActionsShowWhen(
|
|
||||||
_: unknown,
|
|
||||||
__: unknown,
|
|
||||||
host: EditorHost
|
|
||||||
) {
|
|
||||||
return (
|
|
||||||
!!host.doc.awarenessStore.getFlag('enable_new_image_actions') &&
|
|
||||||
imageOnlyShowWhen(_, __, host)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function mindmapRootShowWhen(_: unknown, __: unknown, host: EditorHost) {
|
export function mindmapRootShowWhen(_: unknown, __: unknown, host: EditorHost) {
|
||||||
const selected = getCopilotSelectedElems(host);
|
const selected = getCopilotSelectedElems(host);
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import {
|
|||||||
} from '../../_common/icons.js';
|
} from '../../_common/icons.js';
|
||||||
import {
|
import {
|
||||||
actionToHandler,
|
actionToHandler,
|
||||||
experimentalImageActionsShowWhen,
|
|
||||||
imageOnlyShowWhen,
|
imageOnlyShowWhen,
|
||||||
mindmapChildShowWhen,
|
mindmapChildShowWhen,
|
||||||
mindmapRootShowWhen,
|
mindmapRootShowWhen,
|
||||||
@@ -469,7 +468,7 @@ const generateGroup: AIItemGroupConfig = {
|
|||||||
{
|
{
|
||||||
name: 'AI image filter',
|
name: 'AI image filter',
|
||||||
icon: ImproveWritingIcon,
|
icon: ImproveWritingIcon,
|
||||||
showWhen: experimentalImageActionsShowWhen,
|
showWhen: imageOnlyShowWhen,
|
||||||
subItem: imageFilterSubItem,
|
subItem: imageFilterSubItem,
|
||||||
subItemOffset: [12, -4],
|
subItemOffset: [12, -4],
|
||||||
beta: true,
|
beta: true,
|
||||||
@@ -477,7 +476,7 @@ const generateGroup: AIItemGroupConfig = {
|
|||||||
{
|
{
|
||||||
name: 'Image processing',
|
name: 'Image processing',
|
||||||
icon: AIImageIcon,
|
icon: AIImageIcon,
|
||||||
showWhen: experimentalImageActionsShowWhen,
|
showWhen: imageOnlyShowWhen,
|
||||||
subItem: imageProcessingSubItem,
|
subItem: imageProcessingSubItem,
|
||||||
subItemOffset: [12, -6],
|
subItemOffset: [12, -6],
|
||||||
beta: true,
|
beta: true,
|
||||||
@@ -485,7 +484,7 @@ const generateGroup: AIItemGroupConfig = {
|
|||||||
{
|
{
|
||||||
name: 'Generate a caption',
|
name: 'Generate a caption',
|
||||||
icon: AIPenIcon,
|
icon: AIPenIcon,
|
||||||
showWhen: experimentalImageActionsShowWhen,
|
showWhen: imageOnlyShowWhen,
|
||||||
beta: true,
|
beta: true,
|
||||||
handler: actionToHandler(
|
handler: actionToHandler(
|
||||||
'generateCaption',
|
'generateCaption',
|
||||||
|
|||||||
@@ -126,7 +126,6 @@ const blocksuiteFeatureFlags: Partial<Record<keyof BlockSuiteFlags, string>> = {
|
|||||||
enable_expand_database_block: 'Enable Expand Database Block',
|
enable_expand_database_block: 'Enable Expand Database Block',
|
||||||
enable_database_statistics: 'Enable Database Block Statistics',
|
enable_database_statistics: 'Enable Database Block Statistics',
|
||||||
enable_block_query: 'Enable Todo Block Query',
|
enable_block_query: 'Enable Todo Block Query',
|
||||||
enable_new_image_actions: 'Enable New Image Actions',
|
|
||||||
enable_edgeless_text: 'Enable New Edgeless Text',
|
enable_edgeless_text: 'Enable New Edgeless Text',
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user