diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 035a2b4a..c4fc5d19 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,10 +20,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Fetch Sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Gradle Wrapper Validation - uses: gradle/wrapper-validation-action@v1 + uses: gradle/actions/wrapper-validation@v3 build: name: Build Plugin @@ -36,15 +36,16 @@ jobs: changelog: ${{ steps.properties.outputs.changelog }} steps: - name: Fetch Sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 - - name: Set up JDK 11 - uses: actions/setup-java@v1 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: 11 + java-version: 17 + distribution: 'zulu' - name: Restore Gradle Cache - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: | ~/.gradle/caches @@ -66,7 +67,7 @@ jobs: # run: ./gradlew runPluginVerifier - name: Upload artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v4 with: name: plugin-artifact path: ./plugin/build/distributions/${{ steps.properties.outputs.name }}-${{ steps.properties.outputs.version }}.zip @@ -79,7 +80,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Fetch Sources - uses: actions/checkout@v2 + uses: actions/checkout@v4 # Remove old release drafts by using the curl request for the available releases with draft flag - name: Remove Old Release Drafts @@ -106,7 +107,7 @@ jobs: # Download plugin artifact provided by the previous job - name: Download Artifact - uses: actions/download-artifact@v1 + uses: actions/download-artifact@v4 with: name: plugin-artifact diff --git a/CHANGELOG.md b/CHANGELOG.md index 95a63409..6fa5313a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Intellij PDF Viewer Plugin Changelog ## 0.16.0 -- Support 2024.1 ([#90](https://github.com/FirstTimeInForever/intellij-pdf-viewer/issues/90)) +- Support 2024.1 ([#90](https://github.com/FirstTimeInForever/intellij-pdf-viewer/issues/90), [#98](https://github.com/FirstTimeInForever/intellij-pdf-viewer/issues/98)) ## 0.15.0 - Fix scrolling performance on Mac ([#51](https://github.com/FirstTimeInForever/intellij-pdf-viewer/issues/51)) diff --git a/build.gradle.kts b/build.gradle.kts index ab5cfb42..9bf217f6 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,5 +2,4 @@ plugins { kotlin("jvm") apply false kotlin("multiplatform") apply false kotlin("plugin.serialization") apply false - kotlin("js") apply false } diff --git a/gradle.properties b/gradle.properties index 2a25f6dd..0b33f06f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,20 +6,20 @@ version = 0.16.0 #platformVersion = 213.6777.52 #IntelliJ IDEA 2021.1.2 Preview -platformVersion = 241.10840-EAP-CANDIDATE-SNAPSHOT -pluginSinceVersion = 223.1 +platformVersion = 2024.1 +pluginSinceVersion = 241 pluginUntilVersion = 299.* -pluginVerifierIdeVersions = 213.6777.52, 222.3739.54 +pluginVerifierIdeVersions = 241.15989.69 -texifyVersion = 0.7.29 +texifyVersion = 0.9.4 nodeVersion = 18.16.0 -kotlinVersion = 1.8.0 +kotlinVersion = 1.9.20 kotlinxSerializationJsonVersion = 1.2.1 kotlin.code.style = official kotlin.mpp.stability.nowarn = true # https://kotlinlang.org/docs/reference/using-gradle.html#dependency-on-the-standard-library for details. -#kotlin.stdlib.default.dependency = false +kotlin.stdlib.default.dependency = false diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c053..7454180f 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 2e6e5897..d951fac2 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index af6708ff..1b6c7873 100755 --- a/gradlew +++ b/gradlew @@ -1,78 +1,129 @@ -#!/usr/bin/env sh +#!/bin/sh + +# +# Copyright © 2015-2021 the original authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ############################################################################## -## -## Gradle start up script for UN*X -## +# +# Gradle start up script for POSIX generated by Gradle. +# +# Important for running: +# +# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is +# noncompliant, but you have some other compliant shell such as ksh or +# bash, then to run this script, type that shell name before the whole +# command line, like: +# +# ksh Gradle +# +# Busybox and similar reduced shells will NOT work, because this script +# requires all of these POSIX shell features: +# * functions; +# * expansions «$var», «${var}», «${var:-default}», «${var+SET}», +# «${var#prefix}», «${var%suffix}», and «$( cmd )»; +# * compound commands having a testable exit status, especially «case»; +# * various built-in commands including «command», «set», and «ulimit». +# +# Important for patching: +# +# (2) This script targets any POSIX shell, so it avoids extensions provided +# by Bash, Ksh, etc; in particular arrays are avoided. +# +# The "traditional" practice of packing multiple parameters into a +# space-separated string is a well documented source of bugs and security +# problems, so this is (mostly) avoided, by progressively accumulating +# options in "$@", and eventually passing that to Java. +# +# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, +# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; +# see the in-line comments for details. +# +# There are tweaks for specific operating systems such as AIX, CygWin, +# Darwin, MinGW, and NonStop. +# +# (3) This script is generated from the Groovy template +# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# within the Gradle project. +# +# You can find Gradle at https://github.com/gradle/gradle/. +# ############################################################################## # Attempt to set APP_HOME + # Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi +app_path=$0 + +# Need this for daisy-chained symlinks. +while + APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path + [ -h "$app_path" ] +do + ls=$( ls -ld "$app_path" ) + link=${ls#*' -> '} + case $link in #( + /*) app_path=$link ;; #( + *) app_path=$APP_HOME$link ;; + esac done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null + +APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` +APP_BASE_NAME=${0##*/} # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m"' +DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' # Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" +MAX_FD=maximum warn () { echo "$*" -} +} >&2 die () { echo echo "$*" echo exit 1 -} +} >&2 # OS specific support (must be 'true' or 'false'). cygwin=false msys=false darwin=false nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; +case "$( uname )" in #( + CYGWIN* ) cygwin=true ;; #( + Darwin* ) darwin=true ;; #( + MSYS* | MINGW* ) msys=true ;; #( + NONSTOP* ) nonstop=true ;; esac CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar + # Determine the Java command to use to start the JVM. if [ -n "$JAVA_HOME" ] ; then if [ -x "$JAVA_HOME/jre/sh/java" ] ; then # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" + JAVACMD=$JAVA_HOME/jre/sh/java else - JAVACMD="$JAVA_HOME/bin/java" + JAVACMD=$JAVA_HOME/bin/java fi if [ ! -x "$JAVACMD" ] ; then die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME @@ -81,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the location of your Java installation." fi else - JAVACMD="java" + JAVACMD=java which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the @@ -89,84 +140,95 @@ location of your Java installation." fi # Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi +if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then + case $MAX_FD in #( + max*) + MAX_FD=$( ulimit -H -n ) || + warn "Could not query maximum file descriptor limit" + esac + case $MAX_FD in #( + '' | soft) :;; #( + *) + ulimit -n "$MAX_FD" || + warn "Could not set maximum file descriptor limit to $MAX_FD" + esac fi -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi +# Collect all arguments for the java command, stacking in reverse order: +# * args from the command line +# * the main class name +# * -classpath +# * -D...appname settings +# * --module-path (only if needed) +# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. + +# For Cygwin or MSYS, switch paths to Windows format before running java +if "$cygwin" || "$msys" ; then + APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) + CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) + + JAVACMD=$( cygpath --unix "$JAVACMD" ) -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" + for arg do + if + case $arg in #( + -*) false ;; # don't mess with options #( + /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath + [ -e "$t" ] ;; #( + *) false ;; + esac + then + arg=$( cygpath --path --ignore --mixed "$arg" ) fi - i=$((i+1)) + # Roll the args list around exactly as many times as the number of + # args, so each arg winds up back in the position where it started, but + # possibly modified. + # + # NB: a `for` loop captures its iteration list before it begins, so + # changing the positional parameters here affects neither the number of + # iterations, nor the values presented in `arg`. + shift # remove old arg + set -- "$@" "$arg" # push replacement arg done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac fi -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=$(save "$@") - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi +# Collect all arguments for the java command; +# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of +# shell script including quotes and variable substitutions, so put them in +# double quotes to make sure that they get re-expanded; and +# * put everything else in single quotes, so that it's not re-expanded. + +set -- \ + "-Dorg.gradle.appname=$APP_BASE_NAME" \ + -classpath "$CLASSPATH" \ + org.gradle.wrapper.GradleWrapperMain \ + "$@" + +# Use "xargs" to parse quoted args. +# +# With -n1 it outputs one arg per line, with the quotes and backslashes removed. +# +# In Bash we could simply go: +# +# readarray ARGS < <( xargs -n1 <<<"$var" ) && +# set -- "${ARGS[@]}" "$@" +# +# but POSIX shell has neither arrays nor command substitution, so instead we +# post-process each arg (as a line of input to sed) to backslash-escape any +# character that might be a shell metacharacter, then use eval to reverse +# that process (while maintaining the separation between arguments), and wrap +# the whole thing up as a single "set" statement. +# +# This will of course break if any of these variables contains a newline or +# an unmatched quote. +# + +eval "set -- $( + printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | + xargs -n1 | + sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | + tr '\n' ' ' + )" '"$@"' exec "$JAVACMD" "$@" diff --git a/gradlew.bat b/gradlew.bat index 0f8d5937..ac1b06f9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -1,3 +1,19 @@ +@rem +@rem Copyright 2015 the original author or authors. +@rem +@rem Licensed under the Apache License, Version 2.0 (the "License"); +@rem you may not use this file except in compliance with the License. +@rem You may obtain a copy of the License at +@rem +@rem https://www.apache.org/licenses/LICENSE-2.0 +@rem +@rem Unless required by applicable law or agreed to in writing, software +@rem distributed under the License is distributed on an "AS IS" BASIS, +@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@rem See the License for the specific language governing permissions and +@rem limitations under the License. +@rem + @if "%DEBUG%" == "" @echo off @rem ########################################################################## @rem @@ -13,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" +set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -35,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -45,28 +64,14 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar + @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell diff --git a/mpi/build.gradle.kts b/mpi/build.gradle.kts index 2e41ec2d..d42b9909 100644 --- a/mpi/build.gradle.kts +++ b/mpi/build.gradle.kts @@ -28,4 +28,11 @@ kotlin { } } } + targets.all { + compilations.all { + compilerOptions.configure { + freeCompilerArgs.add("-Xexpect-actual-classes") + } + } + } } diff --git a/mpi/src/commonMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/mpi/MessagePipeSupport.kt b/mpi/src/commonMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/mpi/MessagePipeSupport.kt index 715cb586..90bc86f3 100644 --- a/mpi/src/commonMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/mpi/MessagePipeSupport.kt +++ b/mpi/src/commonMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/mpi/MessagePipeSupport.kt @@ -1,5 +1,8 @@ +@file:OptIn(ExperimentalSerializationApi::class) + package com.firsttimeinforever.intellij.pdf.viewer.mpi +import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.decodeFromString import kotlinx.serialization.encodeToString import kotlinx.serialization.json.Json diff --git a/plugin/build.gradle.kts b/plugin/build.gradle.kts index b8a3d5d7..b1c3a76d 100644 --- a/plugin/build.gradle.kts +++ b/plugin/build.gradle.kts @@ -1,4 +1,4 @@ -import org.jetbrains.changelog.closure +import org.jetbrains.changelog.Changelog import org.jetbrains.changelog.markdownToHTML import org.jetbrains.intellij.tasks.PatchPluginXmlTask import org.jetbrains.intellij.tasks.RunIdeTask @@ -11,9 +11,9 @@ plugins { id("java") kotlin("jvm") kotlin("plugin.serialization") - id("org.jetbrains.intellij") version "1.10.1" - id("org.jetbrains.changelog") version "1.1.2" - id("com.github.ben-manes.versions") version "0.41.0" + id("org.jetbrains.intellij") version "1.17.3" + id("org.jetbrains.changelog") version "2.2.0" + id("com.github.ben-manes.versions") version "0.51.0" } group = fromProperties("group") @@ -61,14 +61,13 @@ tasks { compileKotlin { kotlinOptions { jvmTarget = JavaVersion.VERSION_17.toString() - @Suppress("SuspiciousCollectionReassignment") freeCompilerArgs += listOf("-Xopt-in=kotlin.RequiresOptIn", "-Xjvm-default=all") } } changelog { version = "${rootProject.version}" path = Paths.get(projectDir.path, "..", "CHANGELOG.md").toString() - header = closure { project.version } + header = project.version.toString() itemPrefix = "-" keepUnreleasedSection = true unreleasedTerm = "Unreleased" @@ -76,7 +75,7 @@ tasks { withType { sinceBuild.set(fromProperties("pluginSinceVersion")) untilBuild.set(fromProperties("pluginUntilVersion")) - changeNotes.set(changelog.getLatest().withHeader(true).toHTML()) + changeNotes.set(changelog.renderItem(changelog.getLatest().withHeader(true), Changelog.OutputType.HTML)) pluginDescription.set(extractPluginDescription()) } runPluginVerifier { @@ -104,7 +103,7 @@ fun extractPluginDescription(): String { val copyWebViewBuildResults by tasks.registering(Copy::class) { from(webView) - into(Paths.get(buildDir.toString(), "resources", "main", "web-view")) + into(project.layout.buildDirectory.dir("resources/main/web-view")) } tasks.getByName("processResources") { diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfAction.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfAction.kt index e04fb2c7..fb347c36 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfAction.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfAction.kt @@ -7,13 +7,16 @@ import com.intellij.ide.ui.UISettings import com.intellij.notification.Notification import com.intellij.notification.NotificationType import com.intellij.notification.Notifications +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnAction import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.PlatformDataKeys import com.intellij.openapi.fileEditor.FileEditorManager -import com.intellij.openapi.project.Project abstract class PdfAction(protected val viewModeAwareness: ViewModeAwareness = ViewModeAwareness.IDE) : AnAction() { + + override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT + override fun update(event: AnActionEvent) { val editor = findEditorInView(event) with(event.presentation) { diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfPageSpreadActionGroup.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfPageSpreadActionGroup.kt index 09dc1b6e..1107033d 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfPageSpreadActionGroup.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfPageSpreadActionGroup.kt @@ -1,5 +1,6 @@ package com.firsttimeinforever.intellij.pdf.viewer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.DefaultActionGroup @@ -13,4 +14,6 @@ class PdfPageSpreadActionGroup : DefaultActionGroup() { event.presentation.isVisible = PdfAction.hasEditorInView(event) event.presentation.isEnabled = PdfAction.findController(event) != null } + + override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT } diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfSidebarViewModeActionGroup.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfSidebarViewModeActionGroup.kt index 11c6f82d..d4ccb537 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfSidebarViewModeActionGroup.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfSidebarViewModeActionGroup.kt @@ -1,5 +1,6 @@ package com.firsttimeinforever.intellij.pdf.viewer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.DefaultActionGroup @@ -12,4 +13,7 @@ class PdfSidebarViewModeActionGroup : DefaultActionGroup() { event.presentation.isVisible = PdfAction.hasEditorInView(event) event.presentation.isEnabled = PdfAction.findController(event) != null } + + override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT + } diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfToggleAction.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfToggleAction.kt index 7189dc08..b034802e 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfToggleAction.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/actions/PdfToggleAction.kt @@ -1,5 +1,6 @@ package com.firsttimeinforever.intellij.pdf.viewer.actions +import com.intellij.openapi.actionSystem.ActionUpdateThread import com.intellij.openapi.actionSystem.AnActionEvent import com.intellij.openapi.actionSystem.ToggleAction @@ -9,6 +10,8 @@ import com.intellij.openapi.actionSystem.ToggleAction abstract class PdfToggleAction(viewModeAwareness: ViewModeAwareness = ViewModeAwareness.IDE_ONLY) : ToggleAction() { protected open val base: PdfAction = StubAction(viewModeAwareness) + override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.BGT + override fun update(event: AnActionEvent) { super.update(event) base.update(event) diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/report/SendReportBackgroundTask.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/report/SendReportBackgroundTask.kt index 8cb67a9b..472ca79f 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/report/SendReportBackgroundTask.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/report/SendReportBackgroundTask.kt @@ -42,7 +42,7 @@ internal class SendReportBackgroundTask( PdfViewerBundle.message("pdf.viewer.error.report.notifications.submit.failed"), NotificationType.ERROR ).notify(project) - thisLogger().error(exception) + thisLogger().error(exception.toString()) consumer.consume(SubmittedReportInfo(SubmittedReportInfo.SubmissionStatus.FAILED)) } } diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettings.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettings.kt index 868cc217..307db088 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettings.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettings.kt @@ -10,7 +10,6 @@ import com.intellij.openapi.editor.colors.EditorColorsManager import com.intellij.openapi.util.registry.Registry import com.intellij.util.messages.Topic import com.intellij.util.xmlb.XmlSerializerUtil.copyBean -import java.awt.Color @State(name = "PdfViewerSettings", storages = [(Storage("pdf_viewer.xml"))]) class PdfViewerSettings : PersistentStateComponent { diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettingsForm.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettingsForm.kt index 62f0ca63..f1d6313c 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettingsForm.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/settings/PdfViewerSettingsForm.kt @@ -38,7 +38,7 @@ class PdfViewerSettingsForm : JPanel() { else -> "Outline (document structure)" } } - comboBox(DefaultComboBoxModel(SidebarViewMode.values()), renderer) + comboBox(DefaultComboBoxModel(SidebarViewMode.entries.toTypedArray()), renderer) .bindItem(defaultSidebarViewMode) } } diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/structureView/PdfStructureViewModel.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/structureView/PdfStructureViewModel.kt index 123ca9e0..aff444e5 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/structureView/PdfStructureViewModel.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/structureView/PdfStructureViewModel.kt @@ -32,7 +32,7 @@ class PdfStructureViewModel( val wrapper = StructureViewFactoryEx.getInstanceEx(project).structureViewWrapper if (wrapper is StructureViewWrapperImpl) { ApplicationManager.getApplication().invokeLater { - wrapper.rebuild() + wrapper.rebuildNow("Refresh structure view") } } } diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/presentation/PdfPresentationController.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/presentation/PdfPresentationController.kt index 2b6dac01..1c185627 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/presentation/PdfPresentationController.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/presentation/PdfPresentationController.kt @@ -50,7 +50,7 @@ class PdfPresentationController(val viewController: PdfJcefPreviewController) { val originalPosition = MouseInfo.getPointerInfo().location val originalFocusOwner = FocusManager.getCurrentManager().focusOwner val browserComponent = viewController.browser.component - val location = browserComponent.locationOnScreen + // val location = browserComponent.locationOnScreen // val xcenter = browserComponent.width / 2 val ycenter = browserComponent.height / 2 viewController.browser.cefBrowser.setFocus(true) diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfEditorControlPanel.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfEditorControlPanel.kt index 9b4f3158..d2ad4a90 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfEditorControlPanel.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfEditorControlPanel.kt @@ -3,6 +3,8 @@ package com.firsttimeinforever.intellij.pdf.viewer.ui.editor.view.controls import com.firsttimeinforever.intellij.pdf.viewer.actions.PdfActionUtils.createActionToolbar import com.intellij.openapi.Disposable import com.intellij.openapi.actionSystem.ActionPlaces +import com.intellij.openapi.actionSystem.toolbarLayout.RightActionsAdjusterStrategyWrapper +import com.intellij.openapi.actionSystem.toolbarLayout.WrapLayoutStrategy import java.awt.Component import java.awt.Dimension import java.awt.FlowLayout @@ -32,7 +34,7 @@ class PdfEditorControlPanel: JPanel(GridLayout()), Disposable { rightPanel.layout = FlowLayout(FlowLayout.RIGHT, 0, 0) rightPanel.add(rightToolbar.component) - rightToolbar.adjustTheSameSize(true) + rightToolbar.layoutStrategy = RightActionsAdjusterStrategyWrapper(WrapLayoutStrategy(true)) rightPanel.preferredSize = Dimension(Int.MAX_VALUE, 24) add(rightPanel, Component.RIGHT_ALIGNMENT) } diff --git a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfSearchPanel.kt b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfSearchPanel.kt index 132ed4cd..9f95ad2c 100644 --- a/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfSearchPanel.kt +++ b/plugin/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/ui/editor/view/controls/PdfSearchPanel.kt @@ -197,6 +197,8 @@ class PdfSearchPanel(private val viewComponent: PdfEditorViewComponent): JPanel( templatePresentation.selectedIcon = selectedIcon } + override fun getActionUpdateThread(): ActionUpdateThread = ActionUpdateThread.EDT + override fun isSelected(event: AnActionEvent): Boolean { return holdState } diff --git a/plugin/src/main/resources/META-INF/plugin.xml b/plugin/src/main/resources/META-INF/plugin.xml index 44722b8b..f490719f 100644 --- a/plugin/src/main/resources/META-INF/plugin.xml +++ b/plugin/src/main/resources/META-INF/plugin.xml @@ -23,7 +23,7 @@ - + diff --git a/settings.gradle.kts b/settings.gradle.kts index 41bac16d..c6d1c66e 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,6 +13,5 @@ pluginManagement { kotlin("jvm") version kotlinVersion kotlin("plugin.serialization") version kotlinVersion kotlin("multiplatform") version kotlinVersion - kotlin("js") version kotlinVersion } } diff --git a/web-view/viewer/build.gradle.kts b/web-view/viewer/build.gradle.kts index 6f3708ce..75104f29 100644 --- a/web-view/viewer/build.gradle.kts +++ b/web-view/viewer/build.gradle.kts @@ -1,7 +1,5 @@ -import org.jetbrains.kotlin.utils.addToStdlib.safeAs - plugins { - kotlin("js") + kotlin("multiplatform") kotlin("plugin.serialization") } @@ -11,13 +9,6 @@ repositories { mavenCentral() } -dependencies { - implementation(kotlin("stdlib-js")) - implementation(project(":mpi")) - implementation(project(":model")) - implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationJsonVersion") -} - kotlin { js(IR) { browser { @@ -45,10 +36,20 @@ kotlin { } binaries.executable() } + sourceSets { + val jsMain by getting { + dependencies { + implementation(kotlin("stdlib-js")) + implementation(project(":mpi")) + implementation(project(":model")) + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinxSerializationJsonVersion") + } + } + } } artifacts { - val distributionTask = tasks.findByName("browserDistribution")!! + val distributionTask = tasks.findByName("jsBrowserDistribution")!! // TODO: Find a better way to select viewer.js file val targetFile = File(distributionTask.outputs.files.singleFile, "viewer.js") add(configurations.viewerApplicationBundle.name, targetFile) { diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/Application.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/Application.kt similarity index 99% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/Application.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/Application.kt index 56268d65..de1ee0f6 100644 --- a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/Application.kt +++ b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/Application.kt @@ -18,10 +18,8 @@ import kotlinx.browser.window import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.json.Json import kotlinx.serialization.json.decodeFromDynamic -import org.w3c.dom.Document import org.w3c.dom.events.EventListener import org.w3c.dom.events.KeyboardEvent -import org.w3c.dom.events.MouseEvent import kotlin.js.Promise import kotlin.js.json diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/ApplicationFactory.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/ApplicationFactory.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/ApplicationFactory.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/ApplicationFactory.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/BrowserMessagePipe.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/BrowserMessagePipe.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/BrowserMessagePipe.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/BrowserMessagePipe.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/SidebarController.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/SidebarController.kt similarity index 96% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/SidebarController.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/SidebarController.kt index 5cdad4bc..b70b69e2 100644 --- a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/SidebarController.kt +++ b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/SidebarController.kt @@ -33,6 +33,6 @@ class SidebarController(private val viewer: ViewerAdapter) { // console.log(viewer.viewerApp.pdfSidebar) val viewValue = viewer.viewerApp.pdfSidebar.visibleView as Int console.log("Got viewMode value: $viewValue") - return SidebarViewMode.values()[viewValue] + return SidebarViewMode.entries[viewValue] } } diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/Internals.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/Internals.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/Internals.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/Internals.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/MappingException.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/MappingException.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/MappingException.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/MappingException.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ThemeUtils.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ThemeUtils.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ThemeUtils.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ThemeUtils.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerAdapter.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerAdapter.kt similarity index 96% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerAdapter.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerAdapter.kt index b61e4699..968fe6cd 100644 --- a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerAdapter.kt +++ b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerAdapter.kt @@ -20,7 +20,7 @@ class ViewerAdapter(val viewerApp: PdfViewerApplication) { } var pageSpreadState: PageSpreadState - get() = PageSpreadState.values()[viewerApp.pdfViewer.spreadMode] + get() = PageSpreadState.entries[viewerApp.pdfViewer.spreadMode] set(value) { viewerApp.pdfViewer.spreadMode = value.ordinal } @@ -83,7 +83,7 @@ class ViewerAdapter(val viewerApp: PdfViewerApplication) { } val currentScrollDirection: ScrollDirection - get() = ScrollDirection.values()[viewerApp.pdfViewer.scrollMode] + get() = ScrollDirection.entries[viewerApp.pdfViewer.scrollMode] fun setVerticalScroll() { val toolbar = viewerApp.asDynamic().appConfig.secondaryToolbar diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerEvents.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerEvents.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerEvents.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/ViewerEvents.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/Globals.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/Globals.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/Globals.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/Globals.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalOutline.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalOutline.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalOutline.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalOutline.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalPageObject.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalPageObject.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalPageObject.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/InternalPageObject.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfAttachmentViewer.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfAttachmentViewer.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfAttachmentViewer.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfAttachmentViewer.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfDocument.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfDocument.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfDocument.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfDocument.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfEventBus.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfEventBus.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfEventBus.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfEventBus.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindController.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindController.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindController.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindController.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerCommands.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerCommands.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerCommands.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerCommands.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerEvents.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerEvents.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerEvents.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfFindControllerEvents.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfHistory.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfHistory.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfHistory.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfHistory.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfLinkService.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfLinkService.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfLinkService.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfLinkService.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfOutlineViewer.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfOutlineViewer.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfOutlineViewer.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfOutlineViewer.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewer.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewer.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewer.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewer.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerApplication.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerApplication.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerApplication.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerApplication.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerLocation.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerLocation.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerLocation.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerLocation.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerSidebar.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerSidebar.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerSidebar.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/pdfjs/types/PdfViewerSidebar.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/tex/SynctexSearchController.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/tex/SynctexSearchController.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/tex/SynctexSearchController.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/tex/SynctexSearchController.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/CommonBrowserUtilities.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/CommonBrowserUtilities.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/CommonBrowserUtilities.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/CommonBrowserUtilities.kt diff --git a/web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/PromiseBuilders.kt b/web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/PromiseBuilders.kt similarity index 100% rename from web-view/viewer/src/main/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/PromiseBuilders.kt rename to web-view/viewer/src/jsMain/kotlin/com/firsttimeinforever/intellij/pdf/viewer/application/utility/PromiseBuilders.kt