Skip to content

Commit

Permalink
Revert "feat(ai): Create an "AI Image" custom block #25670" (#26483)
Browse files Browse the repository at this point in the history
This reverts commit 4b7b189.
  • Loading branch information
fmontes committed Oct 20, 2023
1 parent eabbb0a commit 6489666
Show file tree
Hide file tree
Showing 30 changed files with 14 additions and 1,358 deletions.
10 changes: 2 additions & 8 deletions core-web/libs/block-editor/src/lib/block-editor.module.ts
Expand Up @@ -11,8 +11,6 @@ import { DotBlockEditorComponent } from './components/dot-block-editor/dot-block
import { DotEditorCountBarComponent } from './components/dot-editor-count-bar/dot-editor-count-bar.component';
import {
AIContentPromptComponent,
AIContentActionsComponent,
AIImagePromptComponent,
BubbleLinkFormComponent,
BubbleMenuButtonComponent,
BubbleMenuComponent,
Expand Down Expand Up @@ -54,9 +52,7 @@ import { SharedModule } from './shared/shared.module';
DotBlockEditorComponent,
DotEditorCountBarComponent,
FloatingButtonComponent,
AIContentPromptComponent,
AIContentActionsComponent,
AIImagePromptComponent
AIContentPromptComponent
],
providers: [DotUploadFileService, LoggerService, StringUtils, AiContentService],
exports: [
Expand All @@ -67,9 +63,7 @@ import { SharedModule } from './shared/shared.module';
SharedModule,
BubbleFormComponent,
DotBlockEditorComponent,
AIContentPromptComponent,
AIContentActionsComponent,
AIImagePromptComponent
AIContentPromptComponent
]
})
export class BlockEditorModule {}
Expand Up @@ -306,45 +306,6 @@
}
}
}

.ai-content-container {
&.ProseMirror-selectednode {
background-color: $color-palette-primary-op-20;
border: 1px solid $color-palette-primary-300;
}
}

.loader-style {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
min-height: 12.5rem;
min-width: 25rem;
width: 25.5625rem;
height: 17.375rem;
padding: 0.5rem;
border-radius: 0.5rem;
border: 1.5px solid $color-palette-gray-400;
}

.p-progress-spinner {
border: 5px solid $color-palette-gray-300;
border-radius: 50%;
border-top: 5px solid $color-palette-primary;
width: 2.4rem;
height: 2.4rem;
animation: spin 1s linear infinite;
}

@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
}

tiptap-editor {
Expand Down
Expand Up @@ -50,20 +50,17 @@ import {
FREEZE_SCROLL_KEY,
AssetUploader,
DotComands,
AIContentPromptExtension,
AIImagePromptExtension,
AIContentActionsExtension
AIContentPromptExtension
} from '../../extensions';
import { DotPlaceholder } from '../../extensions/dot-placeholder/dot-placeholder-plugin';
import { ContentletBlock, ImageNode, VideoNode, AIContentNode, LoaderNode } from '../../nodes';
import { ContentletBlock, ImageNode, VideoNode } from '../../nodes';
import {
formatHTML,
removeInvalidNodes,
SetDocAttrStep,
DotMarketingConfigService,
RestoreDefaultDOMAttrs
} from '../../shared';

@Component({
selector: 'dot-block-editor',
templateUrl: './dot-block-editor.component.html',
Expand Down Expand Up @@ -112,9 +109,7 @@ export class DotBlockEditorComponent implements OnInit, OnDestroy {
['dotContent', ContentletBlock(this.injector)],
['image', ImageNode],
['video', VideoNode],
['table', DotTableExtension()],
['aiContent', AIContentNode],
['loader', LoaderNode]
['table', DotTableExtension()]
]);

private destroy$: Subject<boolean> = new Subject<boolean>();
Expand Down Expand Up @@ -386,8 +381,6 @@ export class DotBlockEditorComponent implements OnInit, OnDestroy {
DotBubbleMenuExtension(this.viewContainerRef),
BubbleFormExtension(this.viewContainerRef),
AIContentPromptExtension(this.viewContainerRef),
AIImagePromptExtension(this.viewContainerRef),
AIContentActionsExtension(this.viewContainerRef),
DotFloatingButton(this.injector, this.viewContainerRef),
DotTableCellExtension(this.viewContainerRef),
BubbleAssetFormExtension(this.viewContainerRef),
Expand Down
Expand Up @@ -173,9 +173,7 @@ function execCommand({
subscript: () => editor.chain().setSubscript().focus().run(),
superscript: () => editor.chain().setSuperscript().focus().run(),
video: () => editor.commands.openAssetForm({ type: 'video' }),
aiContentPrompt: () => editor.commands.openAIPrompt(),
aiContent: () => editor.commands.insertAINode(),
aiImagePrompt: () => editor.commands.openImagePrompt()
aiContentPrompt: () => editor.commands.openAIPrompt()
};

getCustomActions(customBlocks).forEach((option) => {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 6489666

Please sign in to comment.