Skip to content

Commit 117d51c

Browse files
authored
Merge pull request #254 from com-pas/release_compas-open-scd_with_v0-33-0
chore: merging v0.33.0 from open-scd into compas-open-scd
2 parents 1148b2e + 2e8b8a1 commit 117d51c

File tree

104 files changed

+1534
-422
lines changed

Some content is hidden

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

104 files changed

+1534
-422
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
44

5+
## [0.33.0](https://github.com/openscd/open-scd/compare/v0.32.0...v0.33.0) (2023-06-22)
6+
7+
8+
### Features
9+
10+
* **openscd:** Move progress indicator beneath plugin tabs ([#1181](https://github.com/openscd/open-scd/issues/1181)) ([a7a7081](https://github.com/openscd/open-scd/commits/a7a7081a32ee14998d0ead75ffb89ba2726631f8)), closes [#1178](https://github.com/openscd/open-scd/issues/1178)
11+
12+
13+
### Bug Fixes
14+
15+
* **editing:** use editCount property for change propagation ([#1233](https://github.com/openscd/open-scd/issues/1233)) ([548f63b](https://github.com/openscd/open-scd/commits/548f63b5b35dac6772230004e6ca7859cf3337b8))
16+
* escaped symbols in regex patterns ([#1266](https://github.com/openscd/open-scd/issues/1266)) ([de2dd0d](https://github.com/openscd/open-scd/commits/de2dd0dc2351c8feb6a70da62e43640334df571b))
17+
* goose subscription reflects state incorrectly ([#1261](https://github.com/openscd/open-scd/issues/1261)) ([4440bff](https://github.com/openscd/open-scd/commits/4440bff63c0ebe816a9fdc25f8af6da1ca6645f4))
18+
519
## [0.31.0](https://github.com/openscd/open-scd/compare/v0.30.0...v0.31.0) (2023-05-02)
620

721

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,5 @@
4040
"purpose": "maskable"
4141
}
4242
],
43-
"version": "0.31.0"
43+
"version": "0.33.0"
4444
}

package-lock.json

Lines changed: 2 additions & 81 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "open-scd",
3-
"version": "0.31.0",
3+
"version": "0.33.0",
44
"repository": "https://github.com/openscd/open-scd.git",
55
"description": "A bottom-up substation configuration designer for projects described using SCL `IEC 61850-6` Edition 2 or greater.",
66
"keywords": [
@@ -17,7 +17,6 @@
1717
"module": "open-scd.js",
1818
"type": "module",
1919
"dependencies": {
20-
"@material/mwc-circular-progress-four-color": "0.22.1",
2120
"@material/mwc-dialog": "0.22.1",
2221
"@material/mwc-drawer": "0.22.1",
2322
"@material/mwc-fab": "0.22.1",

src/Editing.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -424,16 +424,6 @@ export function Editing<TBase extends LitElementConstructor>(Base: TBase) {
424424

425425
if (!this.doc) return;
426426

427-
const newDoc = document.implementation.createDocument(
428-
this.doc.lookupNamespaceURI(''),
429-
this.doc.documentElement.tagName,
430-
this.doc.doctype
431-
);
432-
433-
// change the document object reference to enable reactive updates
434-
newDoc.documentElement.replaceWith(this.doc.documentElement);
435-
this.doc = newDoc;
436-
437427
await this.updateComplete;
438428
this.dispatchEvent(newValidateEvent());
439429
}

src/Hosting.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ export function Hosting<
295295
wrapFocus
296296
@action=${(ae: CustomEvent<ActionDetail>) => {
297297
//FIXME: dirty hack to be fixed in open-scd-core
298-
// if clause not neccassary when oscd... compenents in open-scd not list
298+
// if clause not necessary when oscd... components in open-scd not list
299299
if (ae.target instanceof List)
300300
(<MenuItem>(
301301
this.menu.filter(

src/Logging.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ function getPluginName(src: string): string {
6363
* A mixin adding a `history` property to any `LitElement`, in which
6464
* incoming [[`LogEvent`]]s are logged.
6565
*
66-
* For [[`EditorAction`]] entries, also sets `currentAction` to the index of
66+
* For [[`EditorAction`]] entries, also sets `editCount` to the index of
6767
* the committed action, allowing the user to go to `previousAction` with
6868
* `undo()` if `canUndo` and to go to `nextAction` with `redo()` if `canRedo`.
6969
*
@@ -79,7 +79,7 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
7979
history: LogEntry[] = [];
8080
/** Index of the last [[`EditorAction`]] applied. */
8181
@property({ type: Number })
82-
currentAction = -1;
82+
editCount = -1;
8383
@property()
8484
diagnoses = new Map<string, IssueDetail[]>();
8585
@internalProperty()
@@ -93,7 +93,7 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
9393
@query('#issue') issueUI!: Snackbar;
9494

9595
get canUndo(): boolean {
96-
return this.currentAction >= 0;
96+
return this.editCount >= 0;
9797
}
9898
get canRedo(): boolean {
9999
return this.nextAction >= 0;
@@ -102,15 +102,15 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
102102
get previousAction(): number {
103103
if (!this.canUndo) return -1;
104104
return this.history
105-
.slice(0, this.currentAction)
105+
.slice(0, this.editCount)
106106
.map(entry => (entry.kind == 'action' ? true : false))
107107
.lastIndexOf(true);
108108
}
109109
get nextAction(): number {
110110
let index = this.history
111-
.slice(this.currentAction + 1)
111+
.slice(this.editCount + 1)
112112
.findIndex(entry => entry.kind == 'action');
113-
if (index >= 0) index += this.currentAction + 1;
113+
if (index >= 0) index += this.editCount + 1;
114114
return index;
115115
}
116116

@@ -129,25 +129,25 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
129129
if (!this.canUndo) return false;
130130
this.dispatchEvent(
131131
newActionEvent(
132-
invert((<CommitEntry>this.history[this.currentAction]).action)
132+
invert((<CommitEntry>this.history[this.editCount]).action)
133133
)
134134
);
135-
this.currentAction = this.previousAction;
135+
this.editCount = this.previousAction;
136136
return true;
137137
}
138138
redo(): boolean {
139139
if (!this.canRedo) return false;
140140
this.dispatchEvent(
141141
newActionEvent((<CommitEntry>this.history[this.nextAction]).action)
142142
);
143-
this.currentAction = this.nextAction;
143+
this.editCount = this.nextAction;
144144
return true;
145145
}
146146

147147
private onLog(le: LogEvent): void {
148148
if (le.detail.kind === 'reset') {
149149
this.history = [];
150-
this.currentAction = -1;
150+
this.editCount = -1;
151151
return;
152152
}
153153

@@ -160,7 +160,7 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
160160
if (entry.action.derived) return;
161161
entry.action.derived = true;
162162
if (this.nextAction !== -1) this.history.splice(this.nextAction);
163-
this.currentAction = this.history.length;
163+
this.editCount = this.history.length;
164164
}
165165

166166
this.history.push(entry);
@@ -210,7 +210,7 @@ export function Logging<TBase extends LitElementConstructor>(Base: TBase) {
210210
class="${entry.kind}"
211211
graphic="icon"
212212
?twoline=${!!entry.message}
213-
?activated=${this.currentAction == history.length - index - 1}
213+
?activated=${this.editCount == history.length - index - 1}
214214
>
215215
<span>
216216
<!-- FIXME: replace tt with mwc-chip asap -->

src/Plugging.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { ifImplemented, Mixin } from './foundation.js';
2525
import { EditingElement } from './Editing.js';
2626
import { officialPlugins } from '../public/js/plugins.js';
2727
import { Nsdoc } from './foundation/nsdoc.js';
28-
28+
import { LoggingElement } from './Logging.js';
2929
const pluginTags = new Map<string, string>();
3030
/**
3131
* Hashes `uri` using cyrb64 analogous to
@@ -176,9 +176,9 @@ const loadedPlugins = new Set<string>();
176176
/** Mixin that manages Plugins in `localStorage` */
177177
export type PluggingElement = Mixin<typeof Plugging>;
178178

179-
export function Plugging<TBase extends new (...args: any[]) => EditingElement>(
180-
Base: TBase
181-
) {
179+
export function Plugging<
180+
TBase extends new (...args: any[]) => EditingElement & LoggingElement
181+
>(Base: TBase) {
182182
class PluggingElement extends Base {
183183
// DIRTY HACK: will refactored with open-scd-core
184184
nsdoc!: Nsdoc;
@@ -289,6 +289,7 @@ export function Plugging<TBase extends new (...args: any[]) => EditingElement>(
289289
content: staticTagHtml`<${tag}
290290
.doc=${this.doc}
291291
.docName=${this.docName}
292+
.editCount=${this.editCount}
292293
.docId=${this.docId}
293294
.pluginId=${plugin.src}
294295
.nsdoc=${this.nsdoc}

src/Waiting.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { html, property, TemplateResult } from 'lit-element';
22

3-
import '@material/mwc-circular-progress-four-color';
3+
import '@material/mwc-linear-progress';
44

55
import {
66
LitElementConstructor,
@@ -41,10 +41,10 @@ export function Waiting<TBase extends LitElementConstructor>(Base: TBase) {
4141

4242
render(): TemplateResult {
4343
return html`${ifImplemented(super.render())}
44-
<mwc-circular-progress-four-color
44+
<mwc-linear-progress
4545
.closed=${!this.waiting}
4646
indeterminate
47-
></mwc-circular-progress-four-color>`;
47+
></mwc-linear-progress>`;
4848
}
4949
}
5050

src/compas/Compasing.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { html, query, state, TemplateResult } from 'lit-element';
1+
import { html, query, state, property, TemplateResult } from 'lit-element';
22

33
import { Mixin } from '../foundation.js';
44
import { EditingElement } from '../Editing.js';
@@ -49,6 +49,9 @@ export function Compasing<TBase extends new (...args: any[]) => EditingElement>(
4949
@state()
5050
private expiredSessionMessage: number = 15 * 60 * 1000;
5151

52+
@property({ type: Number })
53+
editCount = -1;
54+
5255
@query('compas-session-expiring-dialog')
5356
private expiringDialogElement!: CompasSessionExpiringDialogElement;
5457

@@ -145,6 +148,7 @@ export function Compasing<TBase extends new (...args: any[]) => EditingElement>(
145148
<compas-session-expired-dialog
146149
.expiredSessionMessage="${this.expiredSessionMessage}"
147150
.doc="${this.doc}"
151+
.editCount=${this.editCount}
148152
.docName="${this.docName}"
149153
>
150154
</compas-session-expired-dialog>

0 commit comments

Comments
 (0)