Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(developer): prototype of ldml visual editor 🗼 #12790

Draft
wants to merge 21 commits into
base: epic/ldml-editor
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
cea397e
feat(developer): seed ldml visual editor 🗼
srl295 Dec 5, 2024
15c0441
chore(developer): add react/parcel 🗼
srl295 Dec 5, 2024
3ec6f85
chore(developer): update README and package.json 🗼
srl295 Dec 16, 2024
d758a3b
chore(developer): ldml-editor: unbreak: add version number 🗼
srl295 Dec 20, 2024
e79e92c
chore(developer): add an LDMLCompilerManager
srl295 Dec 20, 2024
079270f
chore(developer): ldml-editor: use NodeCompilerCallbacks 🗼
srl295 Dec 24, 2024
d77c19f
Merge branch 'chore/merge-master-into-epic-ldml-editor' into feat/dev…
srl295 Dec 24, 2024
b2167fe
chore(developer): update for update from master
srl295 Dec 24, 2024
ed94bba
feat(developer): update React side to show if the keyboard loaded or not
srl295 Dec 24, 2024
a8fd0dc
feat(developer): use index.html from parcel
srl295 Dec 26, 2024
900ec9a
feat(developer): initial views 🗼
srl295 Dec 27, 2024
7ba82fb
feat(developer): use react context 🗼
srl295 Dec 27, 2024
ea7dc33
feat(developer): use index.html from parcel
srl295 Dec 27, 2024
ca78a25
feat(developer): reduce log verbosity
srl295 Dec 27, 2024
685fdfb
feat(developer): abandon hashes for style sheets
srl295 Dec 27, 2024
57cafb3
feat(developer): pass up messages to UI 🗼
srl295 Dec 27, 2024
acad884
chore(developer): ldml-editor: refactor, cleanup, comment 🗼
srl295 Dec 30, 2024
6bd82e1
feat(developer): ldml-editor: repertoire viewer 🗼
srl295 Dec 31, 2024
4c73a24
feat(developer): ldml-editor: add info panel
srl295 Dec 31, 2024
0ebe424
feat(developer): ldml-editor: deselect key by default
srl295 Dec 31, 2024
11354b6
feat(developer): ldml-editor: unify key objects
srl295 Dec 31, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions developer/src/kmc/src/util/NodeCompilerCallbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ export class NodeCompilerCallbacks implements CompilerCallbacks {
this.printMessage(event);
}

/** Bottleneck for output */
protected writeString(str: string) {
process.stdout.write(str);
}

private printMessage(event: CompilerEvent) {
if(this.options.logFormat == 'tsv') {
this.printTsvMessage(event);
Expand All @@ -202,7 +207,7 @@ export class NodeCompilerCallbacks implements CompilerCallbacks {
}

private printTsvMessage(event: CompilerEvent) {
process.stdout.write([
this.writeString([
CompilerError.formatFilename(event.filename, {fullPath:true, forwardSlashes:false}),
CompilerError.formatLine(event.line),
CompilerError.formatSeverity(event.code),
Expand All @@ -214,7 +219,7 @@ export class NodeCompilerCallbacks implements CompilerCallbacks {
private printFormattedMessage(event: CompilerEvent) {
const severityColor = severityColors[CompilerError.severity(event.code)] ?? color.reset;
const messageColor = this.messageSpecialColor(event) ?? color.reset;
process.stdout.write(
this.writeString(
(
event.filename
? color.cyan(CompilerError.formatFilename(event.filename)) +
Expand All @@ -228,7 +233,7 @@ export class NodeCompilerCallbacks implements CompilerCallbacks {

if(event.code == InfrastructureMessages.INFO_ProjectBuiltSuccessfully) {
// Special case: we'll add a blank line after project builds
process.stdout.write('\n');
this.writeString('\n');
}
}

Expand Down
2 changes: 2 additions & 0 deletions developer/src/vscode-plugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ node_modules
.vscode-test/
*.vsix
!.vscode
/.parcel-cache
/build
6 changes: 6 additions & 0 deletions developer/src/vscode-plugin/.parcelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@parcel/config-default",
"transformers": {
"*.{ts,tsx}": ["@parcel/transformer-typescript-tsc"]
}
}
2 changes: 1 addition & 1 deletion developer/src/vscode-plugin/.vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
files: 'out/test/**/*.tests.js',
});
3 changes: 1 addition & 2 deletions developer/src/vscode-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ There is also a `build.sh` which works the usual way.

- Open this directory (`vscode-plugin`) in VSCode
- From the Run and Debug toolbar, click Run Extension
- A terminal will automatically open with `npm run watch` recompiling the project.
- Choose a directory containing a .kpj file, and choose the **Terminal > Run Task…** menu item, or the **Tasks: Run Task** command. Select "kpj" and the name, and the compilation should occur in a terminal window.
- Choose a directory containing an .xml LDML file

- You can use the **Developer: Reload Window** command to reload the `[extension development]` window with a new version of the plugin.

Expand Down
64 changes: 64 additions & 0 deletions developer/src/vscode-plugin/app/App.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Keyman is copyright (C) SIL Global. MIT License.
*/

.App pre.code {
text-align: left;

}

.Key {
margin: 0.25em;
display: flow flex-shrink;
flex-grow: 1;
flex-basis: 3em;
white-space-collapse: preserve-spaces;
border: 2px solid gray;
border-radius: 0.25em;
background-color: azure;
padding: 0.25em;
}

.chosenKey {
background-color: navy;
color: white;
}

/*
kbd.unchosenKey {
}
*/

/* .keyBagContainer {
border: 2px solid blue;
} */

.keyList, .repertoire {
border: 1px solid gray;
padding: 0.25em;
width: 50em;
height: 11em;
display: flex;
flex-wrap: wrap;
overflow-y: scroll;
}

.repertoireItem {
padding: 1em;
background-color: gainsboro;
margin: 0.25em;
vertical-align: middle;
box-shadow: .15em .15em gray;
border: 2px solid gray;
font-size: large;
display: flow flex-shrink;
flex-grow: 1;
flex-basis: 1em;
white-space-collapse: preserve-spaces;
}

.layoutRow {
display: flex;
width: fit-content;
}

Loading
Loading