Skip to content

Commit

Permalink
move ocr and media-upload related features to features director
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Sep 21, 2024
1 parent 0f2bf9e commit 322a97e
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions includes/Classifai/Features/AudioTranscriptsGeneration.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ public function rest_endpoint_callback( WP_REST_Request $request ) {
*/
public function enqueue_admin_assets() {
wp_enqueue_script(
'classifai-media-script',
CLASSIFAI_PLUGIN_URL . 'dist/media.js',
array_merge( get_asset_info( 'media', 'dependencies' ), array( 'jquery', 'media-editor', 'lodash' ) ),
get_asset_info( 'media', 'version' ),
'classifai-plugin-media-processing-js',
CLASSIFAI_PLUGIN_URL . 'dist/classifai-plugin-media-processing.js',
array_merge( get_asset_info( 'classifai-plugin-media-processing', 'dependencies' ), array( 'jquery', 'media-editor', 'lodash' ) ),
get_asset_info( 'classifai-plugin-media-processing', 'version' ),
true
);
}
Expand Down
8 changes: 4 additions & 4 deletions includes/Classifai/Features/ImageTextExtraction.php
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,10 @@ public function add_ocr_data_to_api_response() {
*/
public function enqueue_editor_assets() {
wp_enqueue_script(
'editor-ocr',
CLASSIFAI_PLUGIN_URL . 'dist/editor-ocr.js',
array_merge( get_asset_info( 'editor-ocr', 'dependencies' ), array( 'lodash' ) ),
get_asset_info( 'editor-ocr', 'version' ),
'classifai-plugin-editor-ocr-js',
CLASSIFAI_PLUGIN_URL . 'dist/classifai-plugin-editor-ocr.js',
array_merge( get_asset_info( 'classifai-plugin-editor-ocr', 'dependencies' ), array( 'lodash' ) ),
get_asset_info( 'classifai-plugin-editor-ocr', 'version' ),
true
);
}
Expand Down
10 changes: 5 additions & 5 deletions includes/Classifai/Services/ImageProcessing.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ public static function get_service_providers(): array {
*/
public function enqueue_media_scripts() {
wp_enqueue_script(
'classifai-media-script',
CLASSIFAI_PLUGIN_URL . 'dist/media.js',
array_merge( get_asset_info( 'media', 'dependencies' ), array( 'jquery', 'media-editor', 'lodash' ) ),
get_asset_info( 'media', 'version' ),
'classifai-plugin-media-processing-js',
CLASSIFAI_PLUGIN_URL . 'dist/classifai-plugin-media-processing.js',
array_merge( get_asset_info( 'classifai-plugin-media-processing', 'dependencies' ), array( 'jquery', 'media-editor', 'lodash' ) ),
get_asset_info( 'classifai-plugin-media-processing', 'version' ),
true
);

$feature = new DescriptiveTextGenerator();
wp_add_inline_script(
'classifai-media-script',
'classifai-plugin-media-processing-js',
'const classifaiMediaVars = ' . wp_json_encode(
array(
'enabledAltTextFields' => $feature->get_alt_text_settings() ? $feature->get_alt_text_settings() : array(),
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* global ClassifAI */

import { handleClick } from './helpers';
import { handleClick } from '../../helpers';
import { __ } from '@wordpress/i18n';

( function( $ ) { // eslint-disable-line
Expand Down
4 changes: 2 additions & 2 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ module.exports = {
path: path.resolve( __dirname, 'dist' ),
},
entry: {
'editor-ocr': [ './src/js/editor-ocr.js' ],
media: [ './src/js/media.js' ],
admin: [ './src/js/admin.js' ],
'recommended-content-block': [
'./includes/Classifai/Blocks/recommended-content-block/index.js',
Expand All @@ -18,6 +16,8 @@ module.exports = {
'./includes/Classifai/Blocks/recommended-content-block/frontend.js',
],

'classifai-plugin-media-processing': [ './src/js/features/media-processing/media-upload.js' ],

Check failure on line 19 in webpack.config.js

View workflow job for this annotation

GitHub Actions / eslint

Replace `·'./src/js/features/media-processing/media-upload.js'·` with `⏎↹↹↹'./src/js/features/media-processing/media-upload.js',⏎↹↹`
'classifai-plugin-editor-ocr': [ './src/js/features/media-processing/editor-ocr.js' ],

Check failure on line 20 in webpack.config.js

View workflow job for this annotation

GitHub Actions / eslint

Replace `·'./src/js/features/media-processing/editor-ocr.js'·` with `⏎↹↹↹'./src/js/features/media-processing/editor-ocr.js',⏎↹↹`
'classifai-plugin-commands': [ './src/js/features/commands.js' ],
'classifai-plugin-classification': './src/js/features/classification/index.js',

Check failure on line 22 in webpack.config.js

View workflow job for this annotation

GitHub Actions / eslint

Replace `·` with `⏎↹↹↹`
'classifai-plugin-classification-previewer': './src/js/features/classification/previewer.js',

Check failure on line 23 in webpack.config.js

View workflow job for this annotation

GitHub Actions / eslint

Replace `·` with `⏎↹↹↹`
Expand Down

0 comments on commit 322a97e

Please sign in to comment.