Skip to content

Commit

Permalink
Update wrapper to PSPSDFKit for Windows 2.0 (#223)
Browse files Browse the repository at this point in the history
Update references
Make JsonUtils compatible.
update all nuget versions.
removed alert from library search example as this is more than fast enough now.
  • Loading branch information
nickwinder authored May 21, 2019
1 parent 557898d commit 7ca8638
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 26 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-pspdfkit",
"version": "1.23.12",
"version": "1.23.13",
"description": "A React Native module for the PSPDFKit library.",
"keywords": [
"react native",
Expand Down
10 changes: 0 additions & 10 deletions samples/Catalog/Catalog.windows.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@ const examples = [
action: async () => {
await PSPDFKitLibrary.OpenLibrary("MyLibrary");
await PSPDFKitLibrary.EnqueueDocumentsInFolderPicker("MyLibrary");
alert(
'Searching Library for "' +
simpleSearch.searchString +
'". Please wait.'
);
PSPDFKitLibrary.SearchLibrary("MyLibrary", simpleSearch)
.then(result => {
alert("Search : \n" + JSON.stringify(result));
Expand All @@ -155,11 +150,6 @@ const examples = [

await PSPDFKitLibrary.OpenLibrary("AssetsLibrary");
await PSPDFKitLibrary.EnqueueDocumentsInFolder("AssetsLibrary", path);
alert(
'Searching Library for "' +
complexSearchConfiguration.searchString +
'". Please wait.'
);
PSPDFKitLibrary.SearchLibrary("AssetsLibrary", complexSearchConfiguration)
.then(result => {
alert("Search : \n" + JSON.stringify(result));
Expand Down
2 changes: 1 addition & 1 deletion samples/Catalog/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Catalog",
"version": "1.23.12",
"version": "1.23.13",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start"
Expand Down
6 changes: 3 additions & 3 deletions samples/Catalog/windows/Catalog/Catalog.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down Expand Up @@ -246,7 +246,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.0.8</Version>
<Version>6.2.8</Version>
</PackageReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
Expand All @@ -263,7 +263,7 @@
<SDKReference Include="Microsoft.VCLibs, Version=14.0">
<Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name>
</SDKReference>
<SDKReference Include="PSPDFKitSDK, Version=1.12.0">
<SDKReference Include="PSPDFKitSDK, Version=2.0.0">
<Name>PSPDFKit for UWP</Name>
</SDKReference>
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions windows/ReactNativePSPDFKit/ReactNativePSPDFKit/JsonUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ internal static JToken SearchResultsToJson(IDictionary<string, LibraryQueryResul
return queryResultsJson;
}

private static JToken RangeToJson(IRange range)
private static JToken RangeToJson(Range range)
{
return new JObject
{
Expand All @@ -117,9 +117,9 @@ private static JToken RangeToJson(IRange range)
};
}

private static IRange ToRange(JToken rangeJson)
private static Range ToRange(JToken rangeJson)
{
return new Range(rangeJson.Value<int>("postion"), rangeJson.Value<int>("length"));
return new Range(rangeJson.Value<int>("position"), rangeJson.Value<int>("length"));
}

private static JArray LibraryQueryReultToJson(LibraryQueryResult libraryQueryResult)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion Condition=" '$(TargetPlatformVersion)' == '' ">10.0.17134.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.15063.0</TargetPlatformMinVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
Expand Down Expand Up @@ -122,23 +122,23 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
<Version>6.0.8</Version>
<Version>6.2.8</Version>
</PackageReference>
<PackageReference Include="Microsoft.Toolkit.Uwp.UI.Controls">
<Version>4.0.0</Version>
<Version>5.1.1</Version>
</PackageReference>
<PackageReference Include="Microsoft.Xaml.Behaviors.Uwp.Managed">
<Version>2.0.0</Version>
<Version>2.0.1</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>11.0.2</Version>
<Version>12.0.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<SDKReference Include="Microsoft.VCLibs, Version=14.0">
<Name>Visual C++ 2015 Runtime for Universal Windows Platform Apps</Name>
</SDKReference>
<SDKReference Include="PSPDFKitSDK, Version=1.12.0">
<SDKReference Include="PSPDFKitSDK, Version=2.0.0">
<Name>PSPDFKit for UWP</Name>
</SDKReference>
</ItemGroup>
Expand Down Expand Up @@ -169,4 +169,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

0 comments on commit 7ca8638

Please sign in to comment.