-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#3658 - Move commonly used JS editor code to the JS API
- Introduce SCSS defining a set of colors that editors should use for various purposes - Clean up build of the JS API module - Added missing exports to the compact_v2 module - Added markedAnnotations to the AnnotatedText and support filling in when unpacking CompactAnnotatedText
- Loading branch information
Showing
15 changed files
with
207 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Marker file which activates the profile "wicket-module" from the parent POM. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
.../tudarmstadt/ukp/inception/diam/editor/api/resources/InceptionJsApiResourceReference.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://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. | ||
*/ | ||
package de.tudarmstadt.ukp.inception.diam.editor.api.resources; | ||
|
||
import org.apache.wicket.request.resource.JavaScriptResourceReference; | ||
|
||
public class InceptionJsApiResourceReference | ||
extends JavaScriptResourceReference | ||
{ | ||
private static final long serialVersionUID = 1L; | ||
|
||
private static final InceptionJsApiResourceReference INSTANCE = // | ||
new InceptionJsApiResourceReference(); | ||
|
||
/** | ||
* Gets the instance of the resource reference | ||
* | ||
* @return the single instance of the resource reference | ||
*/ | ||
public static InceptionJsApiResourceReference get() | ||
{ | ||
return INSTANCE; | ||
} | ||
|
||
/** | ||
* Private constructor | ||
*/ | ||
private InceptionJsApiResourceReference() | ||
{ | ||
super(InceptionJsApiResourceReference.class, "InceptionJsAPI.min.js"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://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. | ||
*/ | ||
import yargs from 'yargs/yargs' | ||
import { hideBin } from 'yargs/helpers' | ||
import esbuild from 'esbuild' | ||
import { sassPlugin } from 'esbuild-sass-plugin' | ||
import fs from 'fs-extra' | ||
|
||
const argv = yargs(hideBin(process.argv)).argv | ||
|
||
const packagePath = 'de/tudarmstadt/ukp/inception/diam/editor/api/resources/' | ||
|
||
let outbase = `../../../target/js/${packagePath}` | ||
|
||
const defaults = { | ||
bundle: true, | ||
sourcemap: true, | ||
minify: !argv.live, | ||
target: 'es6', | ||
loader: { '.ts': 'ts' }, | ||
logLevel: 'info', | ||
plugins: [sassPlugin()] | ||
} | ||
|
||
if (argv.live) { | ||
defaults.watch = { | ||
onRebuild (error, result) { | ||
if (error) console.error('watch build failed:', error) | ||
else console.log('watch build succeeded:', result) | ||
} | ||
} | ||
outbase = `../../../target/classes/${packagePath}` | ||
} else { | ||
fs.emptyDirSync(outbase) | ||
} | ||
fs.mkdirsSync(`${outbase}`) | ||
|
||
esbuild.build(Object.assign({ | ||
entryPoints: ['index.ts'], | ||
outfile: `${outbase}/InceptionJsAPI.min.js`, | ||
globalName: 'InceptionJsAPI' | ||
}, defaults)) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
inception/inception-js-api/src/main/ts/src/style/InceptionEditorColors.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* | ||
* Licensed to the Technische Universität Darmstadt under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The Technische Universität Darmstadt | ||
* licenses this file to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. | ||
* | ||
* http://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. | ||
*/ | ||
$i7n-focus-color: rgba(255,165,0); | ||
$i7n-focus-bounds-color: rgb(255, 106, 0); | ||
$i7n-match-focus-color: rgb(0, 217, 255); | ||
|
||
:root { | ||
--i7n-focus-color: #{$i7n-focus-color}; | ||
--i7n-focus-bounds-color: #{$i7n-focus-bounds-color}; | ||
--i7n-match-focus-color: #{$i7n-match-focus-color}; | ||
} |
18 changes: 17 additions & 1 deletion
18
inception/inception-js-api/src/main/ts/src/util/Coloring.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters