Skip to content

Commit 791df1d

Browse files
Merge remote-tracking branch 'origin/develop'
2 parents 54857e5 + c8863c7 commit 791df1d

File tree

147 files changed

+6412
-1299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

147 files changed

+6412
-1299
lines changed

CHANGELOG.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,31 @@ Document some advanced types so users may try them out and provide feedback. The
1616

1717
- Read more in the extension documentation
1818

19+
IDL 9.1 introduces new, command-line based progress bars. We have a first-pass of support for these progress bars inside IDL Notebooks.
20+
21+
## 4.6.1 - September 2024
22+
23+
Added layer controls to the Notebook Map.
24+
25+
- Generic title for each layer (raster/vector)
26+
- Slider to make transparent or not
27+
28+
Layers have a handle which allows you to use drag and drop to re-order them. As you re-order, the map updates with changes.
29+
30+
Notebook maps now listen to theme changes from VSCode and, when swapping between light and dark themes, the basemap will update to match the theme of VSCode (light map for light theme; dark map for dark theme)
31+
32+
Fixed an issue where we weren't properly detecting keywords for `obj_destroy` when a custom object class had a `::cleanup` method present
33+
34+
Fixed a bug with auto-complete where, instead of variables, arguments, or functions, you would end up with procedures being suggested inside of a procedure call.
35+
36+
Similar to `call_function()` and `obj_new()`, add special auto-complete for `call_procedure` to give you the list of procedure names with string literals
37+
38+
Fixed a bug where we were incorrectly detecting standalone expressions and reporting as problems.
39+
40+
Fixed a parsing issue where we would not correctly determine the end of ternary operators which could report errors incorrectly in your code.
41+
42+
Re-worked auto-complete to function the same way as hover help. Now, we determine types of features to send from one of our worker threads and then the main thread builds out the completion items. The advantage of this is that we can now send back documentation and other information (which doesn't exist in our worker threads).
43+
1944
## 4.6.0 - August 2024
2045

2146
Fixed an issue where we open a file that we have stopped in, even if it is compiled as a SAVE file. Now, only PRO files will be jumped to.

apps/idl-webview/src/app/services/services/vscode.service.ts

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Injectable } from '@angular/core';
1+
import { Injectable, OnDestroy } from '@angular/core';
22
import {
33
DEFAULT_VSCODE_MESSAGE,
44
IProfilerMessage,
@@ -11,7 +11,7 @@ import { DEFAULT_VSCODE_STATE, IVSCodeState } from '../core/vscode.interface';
1111
@Injectable({
1212
providedIn: 'root',
1313
})
14-
export class VSCodeService {
14+
export class VSCodeService implements OnDestroy {
1515
// things that we emit that others can listen to
1616
messages = new BehaviorSubject<IVSCodeMessage>(DEFAULT_VSCODE_MESSAGE);
1717
newTheme = new BehaviorSubject<boolean>(false);
@@ -51,6 +51,9 @@ export class VSCodeService {
5151
this.handleMessage(state.lastMessage);
5252
}
5353

54+
/**
55+
* Handle message from VSCode
56+
*/
5457
handleMessage(message: IVSCodeMessage) {
5558
// determine what to do with the events
5659
switch (message.command) {
@@ -73,6 +76,9 @@ export class VSCodeService {
7376
this.messages.next(message);
7477
}
7578

79+
/**
80+
* Get state of web app
81+
*/
7682
getState(): IVSCodeState {
7783
let state = this.vscodeApi.getState();
7884
if (this.firstState) {
@@ -85,7 +91,19 @@ export class VSCodeService {
8591
return state;
8692
}
8793

94+
/**
95+
* Set state of web app
96+
*/
8897
setState(state: IVSCodeState) {
8998
this.vscodeApi.setState(state);
9099
}
100+
101+
/**
102+
* Clean up
103+
*/
104+
ngOnDestroy() {
105+
this.messages.complete();
106+
this.newTheme.complete();
107+
this.profiler.complete();
108+
}
91109
}

apps/notebook/components/src/app/app.module.ts

Lines changed: 5 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import '@material/web/all';
2+
13
import {
24
provideHttpClient,
35
withInterceptorsFromDi,
@@ -7,10 +9,6 @@ import { createCustomElement } from '@angular/elements';
79
import { MatIconRegistry } from '@angular/material/icon';
810
import { BrowserModule, DomSanitizer } from '@angular/platform-browser';
911
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
10-
import {
11-
MaterialCssVarsModule,
12-
MaterialCssVarsService,
13-
} from 'angular-material-css-vars';
1412

1513
import { AppComponent } from './app.component';
1614
import { ComponentsModule } from './components/components.module';
@@ -22,13 +20,7 @@ import {
2220
IDL_NB_MAP_PROPERTY_SHEET_SELECTOR,
2321
MapPropertySheetComponent,
2422
} from './components/map/map-property-sheet/map-property-sheet.component';
25-
import { FAST_FORWARD } from './icons/fast-forward';
26-
import { FAST_REWIND } from './icons/fast-rewind';
27-
import { LAYERS } from './icons/layers';
28-
import { MY_LOCATION_FILLED } from './icons/my-location-fill';
29-
import { PAUSE } from './icons/pause';
30-
import { PLAY } from './icons/play';
31-
import { SAVE } from './icons/save';
23+
import { RegisterIcons } from './icons/register-icons';
3224
import { MaterialModule } from './material.module';
3325
import { VSCodeRendererMessenger } from './services/vscode-renderer-messenger.service';
3426

@@ -39,12 +31,10 @@ import { VSCodeRendererMessenger } from './services/vscode-renderer-messenger.se
3931
imports: [
4032
BrowserModule,
4133
BrowserAnimationsModule,
42-
MaterialCssVarsModule.forRoot({}),
4334
MaterialModule,
4435
ComponentsModule,
4536
],
4637
providers: [
47-
MaterialCssVarsService,
4838
VSCodeRendererMessenger,
4939
provideHttpClient(withInterceptorsFromDi()),
5040
],
@@ -54,63 +44,9 @@ export class AppModule implements DoBootstrap {
5444
private injector: Injector,
5545
private appRef: ApplicationRef,
5646
private matIconRegistry: MatIconRegistry,
57-
private domSanitizer: DomSanitizer,
58-
private materialCssVarsService: MaterialCssVarsService
47+
private domSanitizer: DomSanitizer
5948
) {
60-
this.registerIcons();
61-
// this.updateTheme();
62-
}
63-
64-
/**
65-
* Updates the theme based on current CSS variables
66-
*/
67-
updateTheme() {
68-
// get the body element
69-
const body = document.body;
70-
71-
// get css class list
72-
const classes = body.classList;
73-
74-
// flag if dark mode
75-
const isDark = !classes.contains('vscode-light');
76-
77-
// get our colors
78-
const accent = getComputedStyle(body).getPropertyValue(
79-
'--vscode-activityBarBadge-background'
80-
);
81-
82-
// set colors/themes/properties
83-
this.materialCssVarsService.setDarkTheme(isDark);
84-
// this.materialCssVarsService.setPrimaryColor(hex);
85-
this.materialCssVarsService.setAccentColor(accent);
86-
}
87-
88-
/**
89-
* Adds custom icons for use in material
90-
*
91-
* This has been updated to directly include the SVG content
92-
* instead of needing to load the SVGs via HTTP
93-
*/
94-
registerIcons() {
95-
// icons we load
96-
const icons: { [key: string]: any } = {
97-
'fast-forward': FAST_FORWARD,
98-
'fast-rewind': FAST_REWIND,
99-
layers: LAYERS,
100-
my_location_fill: MY_LOCATION_FILLED,
101-
pause: PAUSE,
102-
play: PLAY,
103-
save: SAVE,
104-
};
105-
106-
// process all of our icons
107-
const keys = Object.keys(icons);
108-
for (let i = 0; i < keys.length; i++) {
109-
this.matIconRegistry.addSvgIconLiteral(
110-
keys[i],
111-
this.domSanitizer.bypassSecurityTrustHtml(icons[keys[i]])
112-
);
113-
}
49+
RegisterIcons(this.matIconRegistry, this.domSanitizer);
11450
}
11551

11652
/**

apps/notebook/components/src/app/components/animation-controls/animation-controls.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export function RoundToNearest(num: number, to: number) {
1212
templateUrl: './animation-controls.component.html',
1313
styles: [
1414
`
15-
@import 'shared-styles.scss';
15+
@import 'styles.scss';
1616
`,
1717
],
1818
})

apps/notebook/components/src/app/components/base-renderer.component.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Component, Input, SkipSelf } from '@angular/core';
1+
import { Component, Input, OnDestroy, SkipSelf } from '@angular/core';
22
import {
33
IDLNotebook_EmbedType,
44
IDLNotebookEmbeddedItem,
55
} from '@idl/types/notebooks';
6+
import { Subscription } from 'rxjs';
67

78
import { VSCodeRendererMessenger } from '../services/vscode-renderer-messenger.service';
89
import { DataSharingService } from './data-sharing.service';
@@ -12,7 +13,9 @@ import { DataSharingService } from './data-sharing.service';
1213
template: ` <p>base works!</p> `,
1314
styles: [],
1415
})
15-
export class BaseRendererComponent<T extends IDLNotebook_EmbedType> {
16+
export class BaseRendererComponent<T extends IDLNotebook_EmbedType>
17+
implements OnDestroy
18+
{
1619
/**
1720
* Track if we set data or not
1821
*/
@@ -38,6 +41,11 @@ export class BaseRendererComponent<T extends IDLNotebook_EmbedType> {
3841
*/
3942
messenger: VSCodeRendererMessenger;
4043

44+
/**
45+
* Subscriptions that we need to clean up
46+
*/
47+
_subscriptions = new Subscription();
48+
4149
/**
4250
* Item we are embedding
4351
*
@@ -58,4 +66,8 @@ export class BaseRendererComponent<T extends IDLNotebook_EmbedType> {
5866
this.messenger = messenger;
5967
this.canMessage = messenger.canPostMessage();
6068
}
69+
70+
ngOnDestroy() {
71+
this._subscriptions.unsubscribe();
72+
}
6173
}

apps/notebook/components/src/app/components/base.component.ts

Lines changed: 0 additions & 40 deletions
This file was deleted.

apps/notebook/components/src/app/components/components.module.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ import {
44
withInterceptorsFromDi,
55
} from '@angular/common/http';
66
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
7-
import { MaterialCssVarsModule } from 'angular-material-css-vars';
87

98
import { MaterialModule } from '../material.module';
109
import { AnimationControlsComponent } from './animation-controls/animation-controls.component';
1110
import { EntryComponent } from './entry/entry.component';
1211
import { ImageComponent } from './image/image.component';
1312
import { ImageAnimatorComponent } from './image-animator/image-animator.component';
1413
import { MapComponent } from './map/map.component';
14+
import { MapLayerCardComponent } from './map/map-layer-card/map-layer-card.component';
1515
import { MapPropertySheetComponent } from './map/map-property-sheet/map-property-sheet.component';
1616
import { PlotComponent } from './plot/plot.component';
1717

@@ -24,6 +24,7 @@ import { PlotComponent } from './plot/plot.component';
2424
MapComponent,
2525
MapPropertySheetComponent,
2626
AnimationControlsComponent,
27+
MapLayerCardComponent,
2728
],
2829
exports: [
2930
EntryComponent,
@@ -33,9 +34,10 @@ import { PlotComponent } from './plot/plot.component';
3334
MapComponent,
3435
MapPropertySheetComponent,
3536
AnimationControlsComponent,
37+
MapLayerCardComponent,
3638
],
3739
schemas: [CUSTOM_ELEMENTS_SCHEMA],
38-
imports: [CommonModule, MaterialCssVarsModule, MaterialModule],
40+
imports: [CommonModule, MaterialModule],
3941
providers: [provideHttpClient(withInterceptorsFromDi())],
4042
})
4143
export class ComponentsModule {}

apps/notebook/components/src/app/components/entry/entry.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div [ngClass]="class" style="width: 100%">
1+
<div [ngClass]="class" style="width: 100%" class="mat-theme">
22
<div *ngIf="hasData; then thenBlock; else elseBlock"></div>
33

44
<ng-template #thenBlock [ngSwitch]="embed.type">

apps/notebook/components/src/app/components/entry/entry.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,14 @@ import { DataSharingService } from '../data-sharing.service';
1717
*/
1818
export const IDL_NB_ENTRY_COMPONENT_SELECTOR = 'idl-nb-entry';
1919

20+
/**
21+
* Class for rendered when not focused
22+
*/
2023
const DEFAULT_CLASS = 'vscode-outlined';
2124

25+
/**
26+
* Class for the renderer when focused
27+
*/
2228
const OUTLINED_CLASS = 'vscode-outlined-focus';
2329

2430
/**
@@ -37,7 +43,6 @@ const OUTLINED_CLASS = 'vscode-outlined-focus';
3743
templateUrl: './entry.component.html',
3844
styles: [
3945
`
40-
@import 'shared-styles.scss';
4146
@import 'styles.scss';
4247
`,
4348
],

apps/notebook/components/src/app/components/image-animator/image-animator.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function RoundToNearest(num: number, to: number) {
2020
templateUrl: './image-animator.component.html',
2121
styles: [
2222
`
23-
@import 'shared-styles.scss';
23+
@import 'styles.scss';
2424
`,
2525
],
2626
})

0 commit comments

Comments
 (0)