first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
{
"$schema": "https://json.schemastore.org/block.json",
"apiVersion": 2,
"name": "tropicalista/pdfembed",
"version": "0.3.5",
"title": "Embed Pdf",
"category": "embed",
"icon": "pdf",
"description": "PDF embedder with official Adobe Embed API.",
"supports": {
"html": false,
"anchor": true
},
"attributes": {
"id": {
"type": "string",
"source": "attribute",
"attribute": "id"
},
"blockId": {
"type": "string"
},
"apiKey": {
"type": "string"
},
"width": {
"type": "number"
},
"height": {
"type": "string",
"default": "500px"
},
"mediaUrl": {
"type": "string"
},
"fileName": {
"type": "string",
"default": "My PDF"
},
"embedMode": {
"type": "string",
"default": ""
},
"showDownloadPDF": {
"type": "boolean",
"default": true
},
"showPrintPDF": {
"type": "boolean",
"default": true
},
"showFullScreen": {
"type": "boolean",
"default": true
},
"showPageControls": {
"type": "boolean",
"default": true
},
"dockPageControls": {
"type": "boolean",
"default": true
},
"enableFormFilling": {
"type": "boolean",
"default": true
},
"showAnnotationTools": {
"type": "boolean",
"default": true
}
},
"textdomain": "pdf-embed",
"editorScript": "file:./build/index.js",
"editorStyle": "file:./build/index.css",
"style": "file:./build/style-index.css",
"viewScript": "file:./build/frontend.js"
}

View File

@@ -0,0 +1 @@
<?php return array('dependencies' => array(), 'version' => '55bf005eb1690bddadd3');

View File

@@ -0,0 +1 @@
(()=>{const e=document.createElement("script");function o(e){e.target.href&&new AdobeDC.View({clientId:pdf_embed.apiKey}).previewFile({content:{location:{url:e.target.href}},metaData:{fileName:new URL(e.target.href).pathname.split("/").pop()}},{embedMode:"LIGHT_BOX"})}e.src="https://documentservices.adobe.com/view-sdk/viewer.js",document.head.appendChild(e),document.addEventListener("adobe_dc_view_sdk.ready",(function(){const e=document.querySelectorAll(".wp-block-tropicalista-pdfembed"),t=navigator.language||navigator.userLanguage;for(let o=0;o<e.length;o++){const a=e[o].dataset;new AdobeDC.View({clientId:a.apikey,divId:e[o].id,locale:t}).previewFile({content:{location:{url:a.mediaurl}},metaData:{fileName:a.filename}},{embedMode:a.embedmode,showDownloadPDF:JSON.parse(a.showdownloadpdf),showPrintPDF:JSON.parse(a.showprintpdf),showPageControls:JSON.parse(a.showpagecontrols),showFullScreen:JSON.parse(a.showfullscreen),dockPageControls:JSON.parse(a.dockpagecontrols),showAnnotationTools:JSON.parse(a.showannotationtools),enableFormFilling:JSON.parse(a.enableformfilling)})}const a=document.querySelectorAll(".embedPdf>a, a.embedPdf");for(let e=0;e<a.length;e++)a[e].onclick=function(e){"pdf"===e.target.href.split(/[#?]/)[0].split(".").pop().trim()&&(e.preventDefault(),o(e))}}))})();

View File

@@ -0,0 +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');

View File

@@ -0,0 +1 @@
.wp-block-tropicalista-pdfembed{display:flex;flex-direction:column;min-height:auto}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
.wp-block-tropicalista-pdfembed{min-height:500px}@media(min-width:320px)and (max-width:480px){.wp-block-tropicalista-pdfembed{max-height:80vh}}

View File

@@ -0,0 +1 @@
{"translation-revision-date":"2022-08-16 17:22+0200","generator":"WP-CLI\/2.6.0","source":"src\/settings.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"it_IT","plural-forms":"nplurals=2; plural=(n != 1);"},"Settings":["Impostazioni"],"API Key":["Chiave API"],"<p>Get your free API key on %s.<\/p>":["<p>Ottenete la vostra chiave API gratuita su %s.<\/p>"],"Embed mode":["Modalit\u00e0 di incorporazione"],"Default":["Default"],"Sized Container":["Contenitore dimensionato"],"Inline":["In linea"],"Show Download PDF":["Mostra Download PDF"],"Show Print PDF":["Mostra Print PDF"],"Show FullScreen Mode":["Mostra modalit\u00e0 FullScreen"],"Page Controls Docked":["Controlli pagina integrati"],"Show Annotation Tools":["Mostra strumenti di annotazione"],"Enable Form Filling":["Abilita compilazione form"],"Height":["Altezza"]}}}

View File

@@ -0,0 +1 @@
{"translation-revision-date":"2022-08-16 17:22+0200","generator":"WP-CLI\/2.6.0","source":"src\/edit.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"it_IT","plural-forms":"nplurals=2; plural=(n != 1);"},"<p>Please insert a <b>free api Key<\/b> in the settings panel on the right. Get your free API key on %s.<\/p>":["<p>Per favore inserisci una <b>chiave api gratuita<\/b> nel pannello di impostazioni a destra. Ottieni la tua chiave API gratuita su %s.<\/p>"],"Missing key":["Chiave mancante"]}}}

View File

@@ -0,0 +1 @@
{"translation-revision-date":"2022-08-16 17:22+0200","generator":"WP-CLI\/2.6.0","source":"build\/index.js","domain":"messages","locale_data":{"messages":{"":{"domain":"messages","lang":"it_IT","plural-forms":"nplurals=2; plural=(n != 1);"},"Settings":["Impostazioni"],"API Key":["Chiave API"],"<p>Get your free API key on %s.<\/p>":["<p>Ottenete la vostra chiave API gratuita su %s.<\/p>"],"Embed mode":["Modalit\u00e0 di incorporazione"],"Default":["Default"],"Sized Container":["Contenitore dimensionato"],"Inline":["In linea"],"Show Download PDF":["Mostra Download PDF"],"Show Print PDF":["Mostra Print PDF"],"Show FullScreen Mode":["Mostra modalit\u00e0 FullScreen"],"Page Controls Docked":["Controlli pagina integrati"],"Show Annotation Tools":["Mostra strumenti di annotazione"],"Enable Form Filling":["Abilita compilazione form"],"Height":["Altezza"],"<p>Please insert a <b>free api Key<\/b> in the settings panel on the right. Get your free API key on %s.<\/p>":["<p>Per favore inserisci una <b>chiave api gratuita<\/b> nel pannello di impostazioni a destra. Ottieni la tua chiave API gratuita su %s.<\/p>"],"Missing key":["Chiave mancante"]}}}

View File

@@ -0,0 +1,115 @@
# Copyright (C) 2022 Formello
# This file is distributed under the GPL2.
msgid ""
msgstr ""
"Project-Id-Version: Pdf Embed 0.1.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/pdf-embed\n"
"POT-Creation-Date: 2022-02-16T10:58:13+01:00\n"
"PO-Revision-Date: 2022-08-16 17:22+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: it_IT\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.1.1\n"
"X-Domain: pdf-embed\n"
#. Plugin Name of the plugin
msgid "Pdf Embed"
msgstr "Pdf Embed"
#. Plugin URI of the plugin
msgid "https://formello.net/"
msgstr "https://formello.net/"
#. Description of the plugin
msgid "PDF embedded with official Adobe API."
msgstr "PDF embedded con le API ufficiali di Adobe."
#. Author of the plugin
msgid "Formello"
msgstr "Formello"
#. Author URI of the plugin
msgid "https://formello.net"
msgstr "https://formello.net"
#: build/index.js:1 src/settings.js:60
msgid "Settings"
msgstr "Impostazioni"
#: build/index.js:1 src/settings.js:62
msgid "API Key"
msgstr "Chiave API"
#: build/index.js:1 src/settings.js:66
msgid "<p>Get your free API key on %s.</p>"
msgstr "<p>Ottenete la vostra chiave API gratuita su %s.</p>"
#: build/index.js:1 src/settings.js:75
msgid "Embed mode"
msgstr "Modalità di incorporazione"
#: build/index.js:1 src/settings.js:78
msgid "Default"
msgstr "Default"
#: build/index.js:1 src/settings.js:79
msgid "Sized Container"
msgstr "Contenitore dimensionato"
#: build/index.js:1 src/settings.js:80
msgid "Inline"
msgstr "In linea"
#: build/index.js:1 src/settings.js:85
msgid "Show Download PDF"
msgstr "Mostra Download PDF"
#: build/index.js:1 src/settings.js:90
msgid "Show Print PDF"
msgstr "Mostra Print PDF"
#: build/index.js:1 src/settings.js:95
msgid "Show FullScreen Mode"
msgstr "Mostra modalità FullScreen"
#: build/index.js:1 src/settings.js:100
msgid "Page Controls Docked"
msgstr "Controlli pagina integrati"
#: build/index.js:1 src/settings.js:105
msgid "Show Annotation Tools"
msgstr "Mostra strumenti di annotazione"
#: build/index.js:1 src/settings.js:110
msgid "Enable Form Filling"
msgstr "Abilita compilazione form"
#: build/index.js:1 src/settings.js:118
msgid "Height"
msgstr "Altezza"
#: build/index.js:1 src/edit.js:112
msgid ""
"<p>Please insert a <b>free api Key</b> in the settings panel on the right. "
"Get your free API key on %s.</p>"
msgstr ""
"<p>Per favore inserisci una <b>chiave api gratuita</b> nel pannello di "
"impostazioni a destra. Ottieni la tua chiave API gratuita su %s.</p>"
#: build/index.js:1 src/edit.js:117
msgid "Missing key"
msgstr "Chiave mancante"
#: block.json
msgctxt "block title"
msgid "Embed Pdf"
msgstr "Pdf Embed"
#: block.json
msgctxt "block description"
msgid "PDF embedder with official Adobe Embed API."
msgstr "PDF embedder con le API ufficiali di Adobe."

View File

@@ -0,0 +1,125 @@
# Copyright (C) 2022 Formello
# This file is distributed under the GPL2.
msgid ""
msgstr ""
"Project-Id-Version: Pdf Embed 0.1.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/pdf-embed\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2022-02-16T10:58:13+01:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.6.0\n"
"X-Domain: pdf-embed\n"
#. Plugin Name of the plugin
msgid "Pdf Embed"
msgstr ""
#. Plugin URI of the plugin
msgid "https://formello.net/"
msgstr ""
#. Description of the plugin
msgid "PDF embedded with official Adobe API."
msgstr ""
#. Author of the plugin
msgid "Formello"
msgstr ""
#. Author URI of the plugin
msgid "https://formello.net"
msgstr ""
#: build/index.js:1
#: src/settings.js:60
msgid "Settings"
msgstr ""
#: build/index.js:1
#: src/settings.js:62
msgid "API Key"
msgstr ""
#: build/index.js:1
#: src/settings.js:66
msgid "<p>Get your free API key on %s.</p>"
msgstr ""
#: build/index.js:1
#: src/settings.js:75
msgid "Embed mode"
msgstr ""
#: build/index.js:1
#: src/settings.js:78
msgid "Default"
msgstr ""
#: build/index.js:1
#: src/settings.js:79
msgid "Sized Container"
msgstr ""
#: build/index.js:1
#: src/settings.js:80
msgid "Inline"
msgstr ""
#: build/index.js:1
#: src/settings.js:85
msgid "Show Download PDF"
msgstr ""
#: build/index.js:1
#: src/settings.js:90
msgid "Show Print PDF"
msgstr ""
#: build/index.js:1
#: src/settings.js:95
msgid "Show FullScreen Mode"
msgstr ""
#: build/index.js:1
#: src/settings.js:100
msgid "Page Controls Docked"
msgstr ""
#: build/index.js:1
#: src/settings.js:105
msgid "Show Annotation Tools"
msgstr ""
#: build/index.js:1
#: src/settings.js:110
msgid "Enable Form Filling"
msgstr ""
#: build/index.js:1
#: src/settings.js:118
msgid "Height"
msgstr ""
#: build/index.js:1
#: src/edit.js:112
msgid "<p>Please insert a <b>free api Key</b> in the settings panel on the right. Get your free API key on %s.</p>"
msgstr ""
#: build/index.js:1
#: src/edit.js:117
msgid "Missing key"
msgstr ""
#: block.json
msgctxt "block title"
msgid "Embed Pdf"
msgstr ""
#: block.json
msgctxt "block description"
msgid "PDF embedder with official Adobe Embed API."
msgstr ""

View File

@@ -0,0 +1,69 @@
<?php
/**
* Plugin Name: Pdf Embed
* Plugin URI: https://formello.net/
* Description: PDF embedded with official Adobe API.
* Version: 0.3.5
* Author: Formello
* Author URI: https://formello.net
* License: GPL2
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: pdf-embed
*
* @package Formello/PdfEmbed
*/
/**
* Registers the block using the metadata loaded from the `block.json` file.
* Behind the scenes, it registers also all assets so they can be enqueued
* through the block editor in the corresponding context.
*
* @see https://developer.wordpress.org/block-editor/how-to-guides/block-tutorial/writing-your-first-block-type/
*/
function pdf_embed_block_init() {
register_block_type_from_metadata(
__DIR__,
);
$args = array(
'type' => 'string',
'sanitize_callback' => 'sanitize_text_field',
'default' => '',
'show_in_rest' => true,
);
register_setting( 'embed_pdf', 'pdf_embed_api_key', $args );
}
add_action( 'init', 'pdf_embed_block_init' );
/**
* Register settings
*/
function pdf_embed_setting() {
wp_add_inline_script(
'tropicalista-pdfembed-editor-script',
'const pdf_embed = ' . wp_json_encode(
array(
'apiKey' => get_option( 'pdf_embed_api_key', '' ),
)
),
'before'
);
wp_add_inline_script(
'tropicalista-pdfembed-view-script',
'const pdf_embed = ' . wp_json_encode(
array(
'apiKey' => get_option( 'pdf_embed_api_key', '' ),
)
),
'before'
);
}
add_action( 'init', 'pdf_embed_setting' );
function pdf_embed_render( $block_content, $block ) {
if ( ! empty( $block['attrs']['embedPdf'] ) ) {
wp_enqueue_script( 'tropicalista-pdfembed-view-script' );
}
return $block_content;
}
add_filter( 'render_block', 'pdf_embed_render', 10, 2 );

View File

@@ -0,0 +1,132 @@
=== 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
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Requires at least: 5.6.0
Requires PHP: 5.6
PDF embedder with official Adobe Embed API.
== Description ==
A simple, responsive and 100% free Gutenberg Block to display PDF on your website using the official [Adobe PDF Embed API](https://www.adobe.io/apis/documentcloud/dcsdk/pdf-embed.html).
[vimeo https://vimeo.com/827868503]
== Features ==
- Embed or inline PDF
- Fully responsive
- Works fine on Chrome, Firefox, Opera, Edge and IE11
- Show download button
- Show print button
- Show full screen
- 🔥Show PDF in Lightbox on button click
== WHATS NEXT ==
If you like this plugin, then consider checking out our other projects:
* [Formello](https://wordpress.org/plugins/formello): a form builder to collect leads, newsletter signup, contact form and more.
* [Popper](https://wordpress.org/plugins/popper): a popup builder to increase leads with exit intent.
* [Mortgage Calculator](https://wordpress.org/plugins/mortgage): a mortgage calculator block for Gutenberg.
* [Search Console](https://wordpress.org/plugins/search-console): view all your search console data inside WordPress admin.
== Installation ==
This section describes how to install the plugin and get it working.
e.g.
1. Upload the plugin files to the `/wp-content/plugins/adobe-pdf` directory, or install the plugin through the WordPress plugins screen directly.
1. Activate the plugin through the 'Plugins' screen in WordPress
== Frequently Asked Questions ==
= Do I need an API key to use this block? =
Yes you will need a free Adobe PDF Embed API.
== Changelog ==
= 0.3.5 =
* Address WP 6.3
= 0.3.4 =
* Added filter to show pdf on Lightbox on button click. Only for ('core/button', 'generateblocks/button')
= 0.3.3 =
* Added better help message.
* Fiz height control showing on inline option.
= 0.3.2 =
* Added full window options to enable form filling.
= 0.3.1 =
* Code linting
* Fix error on inserting
= 0.3.0 =
* Fix new iframe loading in Gutenberg
* Code linting
= 0.2.9 =
* Fix height on editor
* Fix api button
= 0.2.8 =
* Fix new api url
* Fix editor rendering same as frontend
= 0.2.7 =
* Fix correct file to embed due to Adobe migration
= 0.2.6 =
* Fix link on button
= 0.2.5 =
* Fix wrong selector on links again
= 0.2.4 =
* Fix wrong selector on links
= 0.2.3 =
* Better handling of save api key
* Added input on placeholder
* Added light mode to buttons
= 0.2.2 =
* Added comment to function
= 0.2.1 =
* Allow more than one pdf displayed on a page/post
= 0.2.0 =
* Fix missing fileName on upload
= 0.1.9 =
* Fix contributors
* Fix height resizing
= 0.1.8 =
* Fix hardcoded pdf
= 0.1.7 =
* Fix missing assets
= 0.1.6 =
* Fix missing frontend js
= 0.1.3 =
* Better handling of frontend js
* Code optimization
= 0.1.2 =
* Fix missing assets
= 0.1.0 =
* Release