Skip to content

Commit

Permalink
fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
Tropicalista committed Dec 21, 2023
1 parent 2607b54 commit 75f7fc2
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 20 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
}
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => 'a89baf44d7fdd83133ab');
<?php return array('dependencies' => array('wp-api', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-element', 'wp-hooks', 'wp-i18n'), 'version' => '0ed4d39af214a98a2742');
2 changes: 1 addition & 1 deletion build/index.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion pdf-embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Pdf Embed
* Plugin URI: https://formello.net/
* Description: PDF embedded with official Adobe API.
* Version: 0.3.5
* Version: 0.3.6
* Author: Formello
* Author URI: https://formello.net
* License: GPL2
Expand Down Expand Up @@ -59,6 +59,12 @@ function pdf_embed_setting() {
}
add_action( 'init', 'pdf_embed_setting' );

/**
* Adds pdf embed to button
*
* @param string $block_content The content.
* @param array $block The block.
*/
function pdf_embed_render( $block_content, $block ) {
if ( ! empty( $block['attrs']['embedPdf'] ) ) {
wp_enqueue_script( 'tropicalista-pdfembed-view-script' );
Expand Down
7 changes: 5 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
=== Pdf Embed ===
Contributors: Formello, Tropicalista
Tags: pdf, pdf embedder, embed pdf, pdf embed api, pdf block, pdf plugin, block
Tested up to: 6.3
Stable tag: 0.3.5
Tested up to: 6.4.2
Stable tag: 0.3.6
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 5.6.0
Expand Down Expand Up @@ -52,6 +52,9 @@ Yes you will need a free Adobe PDF Embed API.

== Changelog ==

= 0.3.6 =
* Fix error on WP 6.4

= 0.3.5 =
* Address WP 6.3

Expand Down
26 changes: 11 additions & 15 deletions src/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ import {
__experimentalInputControl as InputControl,
Button,
ExternalLink,
Placeholder
Placeholder,
} from '@wordpress/components';
import { useEffect, RawHTML, useState, createInterpolateElement } from '@wordpress/element';
import {
useBlockProps,
} from '@wordpress/block-editor';
useEffect,
RawHTML,
useState,
createInterpolateElement,
} from '@wordpress/element';
import { useBlockProps } from '@wordpress/block-editor';
import './editor.scss';
import Holder from './holder';
import ApiButton from './api-button';
Expand Down Expand Up @@ -45,17 +48,10 @@ export default function Edit( props ) {
<div { ...blockProps }>
<Placeholder
icon={ 'pdf' }
instructions={
<RawHTML>
{ sprintf(
__(
'<p>Please insert a <b>free api Key</b> here or in the settings panel on the right. Get your free API key on %s.</p>',
'pdf-embed'
),
`<a href="https://www.adobe.io/apis/documentcloud/dcsdk/pdf-embed.html" target="_blank">Adobe Official site</a>`
) }
</RawHTML>
}
instructions={ __(
'Please insert a free api Key here or in the settings panel on the right.',
'pdf-embed'
) }
label={ __( 'PDF Embed', 'pdf-embed' ) }
>
<ApiButton { ...props } />
Expand Down
12 changes: 12 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const defaultConfig = require( '@wordpress/scripts/config/webpack.config' );
const path = require( 'path' );

module.exports = {
...defaultConfig,
entry: {
index: [ path.resolve( __dirname, 'src/index.js' ) ],
frontend: [
path.resolve( __dirname, 'src/frontend.js' ),
],
},
};

0 comments on commit 75f7fc2

Please sign in to comment.