Skip to content

Commit

Permalink
Add version 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Leon Dudlik committed Aug 3, 2021
1 parent 6f4feab commit 78a92ca
Show file tree
Hide file tree
Showing 9 changed files with 236 additions and 13 deletions.
30 changes: 29 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,34 @@
#
.DS_Store

# Xcode
#
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate

# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# node.js
#
/node_modules/**
/node_modules/**
npm-debug.log
yarn-error.log
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [2.1.0]

### Fixed

* [iOS] Fixed `export.image.exportType` configuration option.
* [Android] Fixed compiling issues with `compileSdkVersion` 30.

## [2.0.0]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion hooks/dependencies-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ module.exports = (context) => {
BLOCK_START +
`
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.10"
classpath "ly.img.android.sdk:plugin:8.1.3"` +
classpath "ly.img.android.sdk:plugin:8.3.1"` +
"\n" +
BLOCK_END +
"\n";
Expand Down
3 changes: 3 additions & 0 deletions hooks/imglyConfig-gradle-hook.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ imglyConfig {
include 'ui:adjustment'
include 'ui:text-design'
include 'ui:video-trim' // for VideoEditor
include 'ui:video-composition' // for VideoEditor
include 'ui:video-library' // for VideoEditor
include 'ui:audio-composition' // for VideoEditor
// This module is big, remove the serializer if you don't need that feature.
include 'backend:serializer'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "cordova-plugin-photoeditorsdk",
"description": "A Cordova plugin for PhotoEditor SDK. Integrate the photo editor into your own HTML5, iOS or Android app - in minutes!",
"version": "2.0.0",
"version": "2.1.0",
"types": "./types/index.d.ts",
"main": "www/photoeditorsdk.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-photoeditorsdk" version="2.0.0">
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android" id="cordova-plugin-photoeditorsdk" version="2.1.0">
<name>PhotoEditorSDK</name>
<description>A Cordova plugin for PhotoEditor SDK. Integrate the photo editor into your own HTML5, iOS or Android app - in minutes!</description>
<license>BSD-3-Clause</license>
Expand Down Expand Up @@ -68,7 +68,7 @@
<source url="https://github.com/CocoaPods/Specs.git"/>
</config>
<pods use-frameworks="true">
<pod name="PhotoEditorSDK" spec="~> 10.22"/>
<pod name="PhotoEditorSDK" spec="~> 10.24"/>
</pods>
</podspec>
</platform>
Expand Down
7 changes: 5 additions & 2 deletions src/android/PESDKPlugin.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,11 @@ class PESDKPlugin : CordovaPlugin() {

private fun success(intent: Intent?) {

intent ?: return // If resultData is null the result is not from us.
val data = EditorSDKResult(intent)
val data = try {
intent?.let { EditorSDKResult(it) }
} catch (e: EditorSDKResult.NotAnImglyResultException) {
null
} ?: return // If data is null the result is not from us.

SequenceRunnable("Export Done") {
val sourcePath = data.sourceUri
Expand Down
7 changes: 2 additions & 5 deletions src/ios/PESDKPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,7 @@ - (void)present:(CDVInvokedUrlCommand *)command {
}

PESDKPhotoEditViewController *photoEditViewController =
[[PESDKPhotoEditViewController alloc]
initWithPhotoAsset:photoAsset
configuration:configuration
photoEditModel:photoEditModel];
[PESDKPhotoEditViewController photoEditViewControllerWithPhotoAsset:photoAsset configuration:configuration photoEditModel:photoEditModel];
photoEditViewController.modalPresentationStyle =
UIModalPresentationFullScreen;
photoEditViewController.delegate = self;
Expand Down Expand Up @@ -218,7 +215,7 @@ - (void)present:(CDVInvokedUrlCommand *)command {

// Set default values if necessary
id valueExportType = [NSDictionary pesdk_getValue:withConfiguration
valueForKeyPath:@"export.type"
valueForKeyPath:@"export.image.exportType"
default:CDV_IMGLY.kExportTypeFileURL];
id valueExportFile = [NSDictionary
pesdk_getValue:withConfiguration
Expand Down
187 changes: 186 additions & 1 deletion types/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ export interface Configuration {
/**
* Defines all allowed actions for the main screen that are displayed as overlay buttons on the canvas.
* Only buttons for allowed actions are visible.
* @note The `CanvasAction.SOUND_ON_OFF` and `CanvasAction.PLAY_PAUSE` action is only shown when editing videos.
* @example // Defaults to:
* [CanvasAction.UNDO, CanvasAction.REDO]
* [CanvasAction.SOUND_ON_OFF, CanvasAction.PLAY_PAUSE, CanvasAction.UNDO, CanvasAction.REDO]
*/
mainCanvasActions?: Array<
CanvasAction.SOUND_ON_OFF |
CanvasAction.PLAY_PAUSE |
CanvasAction.UNDO |
CanvasAction.REDO
>;
Expand Down Expand Up @@ -139,10 +142,95 @@ export interface Configuration {
/**
* The menu items (or tools) to display in the main menu.
* @example // Defaults to:
* [Tool.COMPOSITION, Tool.TRANSFORM, Tool.FILTER, Tool.ADJUSTMENT, Tool.FOCUS, Tool.STICKER, Tool.TEXT, Tool.TEXT_DESIGN, Tool.OVERLAY, Tool.FRAME, Tool.BRUSH]
* // or if your license does not include `Tool.COMPOSITION`:
* [Tool.TRIM, Tool.TRANSFORM, Tool.FILTER, Tool.ADJUSTMENT, Tool.FOCUS, Tool.STICKER, Tool.TEXT, Tool.TEXT_DESIGN, Tool.OVERLAY, Tool.FRAME, Tool.BRUSH]
*/
tools?: Tool[];

/**
* Configuration options for `Tool.COMPOSITION`.
*/
composition?: {
/**
* Defines all available video clips in the video clip library. Each video clip must be assigned to a category.
* @note If this array is `null` the defaults are used. If this array is empty the video clip library won't be shown when the user
* taps the add button in the composition menu instead the device's media library will be shown directly when `personalVideoClips` is enabled.
* If `personalVideoClips` is disabled in this case the add button in the composition menu won't be shown at all.
* @example // Defaults to:
* []
*/
categories?: (VideoClipCategory)[];
/**
* Defines all allowed actions for the composition tool that are displayed as overlay buttons on the canvas.
* Only buttons for allowed actions are visible.
* @example // Defaults to:
* [CanvasAction.PLAY_PAUSE]
*/
canvasActions?: Array<
CanvasAction.PLAY_PAUSE
>;
/**
* If enabled the user can add personal video clips from the device's media library. A button is added as last item in the composition
* menu or as first item in the video clip library menu in front of the video clip categories if any `categories` are defined.
* @example // Defaults to:
* true
*/
personalVideoClips?: boolean;
/**
* Configuration options for trimming individual video clips of the video composition.
*/
clipTrim?: {
/**
* Defines all allowed actions for the clip trim tool that are displayed as overlay buttons on the canvas.
* Only buttons for allowed actions are visible.
* @example // Defaults to:
* [CanvasAction.DELETE, CanvasAction.PLAY_PAUSE]
*/
canvasActions?: Array<
CanvasAction.DELETE |
CanvasAction.PLAY_PAUSE
>;
}
}

/**
* Configuration options for `Tool.TRIM`.
*/
trim?: {
/**
* Defines all allowed actions for the trim tool that are displayed as overlay buttons on the canvas.
* Only buttons for allowed actions are visible.
* @example // Defaults to:
* [CanvasAction.DELETE, CanvasAction.PLAY_PAUSE]
*/
canvasActions?: Array<
CanvasAction.PLAY_PAUSE
>;
}

/**
* Configuration options for `Tool.AUDIO`.
*/
audio?: {
/**
* Defines all available audio clips in the audio clip library. Each audio clip must be assigned to a category.
* @example // Defaults to:
* []
*/
categories?: (AudioClipCategory)[];
/**
* Defines all allowed actions for the audio tool that are displayed as overlay buttons on the canvas.
* Only buttons for allowed actions are visible.
* @example // Defaults to:
* [CanvasAction.DELETE]
*/
canvasActions?: Array<
CanvasAction.DELETE |
CanvasAction.PLAY_PAUSE
>;
}

/**
* Configuration options for `Tool.TRANSFORM`.
*/
Expand Down Expand Up @@ -946,8 +1034,12 @@ export interface Configuration {

/** An image and/or video editing tool. */
export enum Tool {
/** A tool to compose a video from multiple video clips and to trim the timeline of the composition and the individual clips. */
COMPOSITION = "composition",
/** A tool to trim the timeline of videos. */
TRIM = "trim",
/** A tool to edit the audio track of videos. */
AUDIO = "audio",
/** A tool to apply an transformation, such as cropping or rotation. */
TRANSFORM = "transform",
/** A tool to apply an image filter effect. */
Expand Down Expand Up @@ -1072,6 +1164,8 @@ export enum CanvasAction {
ADD = "add",
FLIP = "flip",
INVERT = "invert",
SOUND_ON_OFF = "soundonoff",
PLAY_PAUSE = "playpause",
}

/** A sticker action. */
Expand Down Expand Up @@ -1176,6 +1270,97 @@ export interface NamedItem extends UniqueItem {
name: string;
}

/** A media item. */
export interface MediaItem extends UniqueItem {
/**
* The title of the media item.
* @example // Defaults to:
* null
*/
title?: string;
/**
* The artist of the media item.
* @example // Defaults to:
* null
*/
artist?: string;
}

/** A video clip category. */
export interface VideoClipCategory extends NamedItem {
/**
* A URI for the thumbnail image of the category.
* If `null` a placeholder image will be used.
*/
thumbnailURI?: AssetURI;
/**
* Items of the category.
* If `null` an empty category will be created.
* @example // Defaults to:
* null
*/
items?: (VideoClip)[];
}

/** A video clip. */
export interface VideoClip extends MediaItem {
/**
* A URI for the thumbnail image of the video clip.
* If `null` the thumbnail will be automatically generated from the `videoURI`.
* @example // Defaults to:
* null
*/
thumbnailURI?: AssetURI;
/** A URI for the video clip.
* @note Video clips from remote resources can be previewed in the editor but their export will
* fail! Remote video resources are currently supported for debugging purposes only, e.g., when
* loading video clips with `require('./video.mp4')` for debug builds static video assets will be
* resolved to remote URLs served by the development packager.
*/
videoURI: AssetURI;
}

/** A audio clip category. */
export interface AudioClipCategory extends NamedItem {
/**
* A URI for the thumbnail image of the category.
* If `null` a placeholder image will be used.
*/
thumbnailURI?: AssetURI;
/**
* Items of the category.
* If `null` an empty category will be created.
* @example // Defaults to:
* null
*/
items?: (AudioClip)[];
}

/** An audio clip. */
export interface AudioClip extends MediaItem {
/**
* A URI for the thumbnail image of the audio clip.
* If `null` a placeholder image will be used.
* @example // Defaults to:
* null
*/
thumbnailURI?: AssetURI;
/**
* The duration of the audio clip in seconds.
* If `null` the duration will be automatically derived from the asset.
* @example // Defaults to:
* null
*/
duration?: number;
/** A URI for the audio clip.
* @note Audio clips from remote resources can be previewed in the editor but their export will
* fail! Remote audio resources are currently supported for debugging purposes only, e.g., when
* loading audio clips with `require('./audio.mp3')` for debug builds static audio assets will be
* resolved to remote URLs served by the development packager.
*/
audioURI: AssetURI;
}

/** An existing filter category. */
export interface ExistingFilterCategory extends ExistingItem {
/**
Expand Down

0 comments on commit 78a92ca

Please sign in to comment.