lang];
17 | else return {};
18 | }
19 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/sw.js:
--------------------------------------------------------------------------------
1 | self.addEventListener('install', () => {
2 | console.log('Dev (dummy, non-caching) service worker installed');
3 | });
4 |
5 | self.addEventListener('fetch', e => {
6 | e.respondWith(fetch(e.request));
7 | });
8 |
9 | self.addEventListener('activate', () => {
10 | console.log('Dev (dummy, non-caching) service worker activated');
11 | });
12 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/compas/compas-scl-private-missing-compas-elements.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/compas/compas-scl-private-missing-private.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/compas/compas-scl-private-update-existing.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | existing
5 | CID
6 |
7 | Label1
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/compas/save-compas-as-version.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | AmsterdamCS
5 | SCD
6 |
7 | Amsterdam
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/compas/save-compas.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | UtrechtCS
5 | CID
6 |
7 | Utrecht
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/foundation/testFile73.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/foundation/testFile74.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/foundation/testFile81.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/history.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/importieds/emptyproject.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/importieds/invalid.iid:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/importieds/parsererror.iid:
--------------------------------------------------------------------------------
1 | SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="4"
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/no-history.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/nsdoc/IEC_61850-7-2.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/nsdoc/invalid.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/nsdoc/wrong-version.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/updatedesc/testSignalListComma.csv:
--------------------------------------------------------------------------------
1 |
2 | CB_CLOSED,IED2,IN101
3 | CB_OPEN,IED2,IN102
4 | BB1_DS_CLOSED,IED2,IN103
5 | BB1_DS_OPEN,IED2,IN104
6 | BB2_DS_CLOSED,IED2,IN105
7 | BB2_DS_OPEN,IED2,IN106
8 | LINE_DS_CLOSED,IED2,IN107
9 | LINE_DS_CLOSED,IED2
10 | LINE_DS_CLOSED
11 | LINE_DS_CLOSED,IED2,"IN,107"
12 | ,
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/updatedesc/testSignalListSemicolon.csv:
--------------------------------------------------------------------------------
1 | CB_CLOSED;IED2;IN101
2 | CB_OPEN;IED2;IN102
3 | BB1_DS_CLOSED;IED2;IN103
4 | BB1_DS_OPEN;IED2;IN104
5 | BB2_DS_CLOSED;IED2;IN105
6 | BB2_DS_OPEN;IED2;IN106
7 | LINE_DS_CLOSED;IED2;"IN107"
8 | LINE_DS_CLOSED;"IED2"
9 | LINE_DS_CLOSED
10 | ;
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/validators/CompasValidation.scd:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 | existing
7 |
8 |
9 | TrainingIEC61850
10 |
11 |
12 |
13 |
14 |
15 |
16 | 20
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/testfiles/validators/zeroissues.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/__snapshots__/action-icon.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Basic component action-icon with icon property set looks like the latest snapshot"] =
5 | `
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
17 | `;
18 | /* end snapshot Basic component action-icon with icon property set looks like the latest snapshot */
19 |
20 | snapshots["Basic component action-icon with unset icon property looks like the latest snapshot"] =
21 | `
23 |
24 |
25 |
26 |
27 | edit
28 |
29 |
30 |
31 |
32 |
33 |
34 |
36 | `;
37 | /* end snapshot Basic component action-icon with unset icon property looks like the latest snapshot */
38 |
39 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/__snapshots__/action-pane.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["action-pane looks like the latest snapshot"] =
5 | `
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 | `;
22 | /* end snapshot action-pane looks like the latest snapshot */
23 |
24 | snapshots["action-pane with icon property set looks like the latest snapshot"] =
25 | `
26 |
27 |
28 |
29 |
30 | edit
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 | `;
45 | /* end snapshot action-pane with icon property set looks like the latest snapshot */
46 |
47 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/__snapshots__/filtered-list.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["filtered-list looks like its latest snapshot"] =
5 | `
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
26 | `;
27 | /* end snapshot filtered-list looks like its latest snapshot */
28 |
29 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas-editors/__snapshots__/Sitipe.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Sitipe plugin No doc loaded Should look like latest snapshot"] =
5 | `
6 |
7 |
8 | [substation.missing]
9 |
10 |
11 |
12 | `;
13 | /* end snapshot Sitipe plugin No doc loaded Should look like latest snapshot */
14 |
15 | snapshots["Sitipe plugin With Doc loaded Should look like latest snapshot"] =
16 | `
17 |
21 |
22 | `;
23 | /* end snapshot Sitipe plugin With Doc loaded Should look like latest snapshot */
24 |
25 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas-editors/sitipe/sitipe-substation.test.ts:
--------------------------------------------------------------------------------
1 | import { fixture, html, expect } from '@open-wc/testing';
2 |
3 | import '../../../../src/compas-editors/sitipe/sitipe-substation.js';
4 | import { SitipeSubstation } from '../../../../src/compas-editors/sitipe/sitipe-substation.js';
5 |
6 | describe('sitipe-substation', () => {
7 | let element: SitipeSubstation;
8 | let doc: XMLDocument;
9 |
10 | beforeEach(async () => {
11 | doc = await fetch('/test/testfiles/Sitipe.scd')
12 | .then(response => response.text())
13 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
14 |
15 | element = (
16 | await fixture(
17 | html` `
21 | )
22 | );
23 |
24 | await element.updateComplete;
25 | });
26 |
27 | it('looks like the latest snapshot', async () => {
28 | await expect(element).shadowDom.to.equalSnapshot();
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/CompasComment.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import { CompasCommentElement } from '../../../src/compas/CompasComment.js';
4 | import '../../../src/compas/CompasComment.js';
5 |
6 | describe('compas-comment', () => {
7 | let element: CompasCommentElement;
8 | beforeEach(async () => {
9 | element = await fixture(html` `);
10 | });
11 |
12 | it('will be valid', () => {
13 | // When nothing entered it will also be valid.
14 | expect(element.valid()).to.be.true;
15 |
16 | element.value = 'Some comments';
17 | expect(element.valid()).to.be.true;
18 | });
19 |
20 | it('will return entered value', () => {
21 | const value = 'Some comments';
22 | element.value = value;
23 |
24 | expect(element.value).to.be.equal(value);
25 | });
26 |
27 | it('looks like the latest snapshot', async () => {
28 | await expect(element).shadowDom.to.equalSnapshot();
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/CompasImportFromApi.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 | import CompasImportFromApiElement from '../../../src/compas/CompasImportFromApi.js';
3 |
4 | import '../../../src/compas/CompasImportFromApi.js';
5 |
6 | describe('compas-import-from-api', () => {
7 | let element: CompasImportFromApiElement;
8 |
9 | beforeEach(async () => {
10 | element = await fixture(
11 | html` `
12 | );
13 | await element.requestUpdate();
14 | await element.updateComplete;
15 | });
16 |
17 | it('looks like the latest snapshot', async () => {
18 | await expect(element).shadowDom.to.equalSnapshot();
19 | });
20 | });
21 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/CompasLoading.test.ts:
--------------------------------------------------------------------------------
1 | import {fixture, html, expect} from '@open-wc/testing';
2 |
3 | import {CompasLoadingElement} from "../../../src/compas/CompasLoading.js";
4 | import "../../../src/compas/CompasLoading.js";
5 |
6 | describe('compas-loading', () => {
7 | let element: CompasLoadingElement;
8 | beforeEach(async () => {
9 | element = await fixture(
10 | html` `
11 | );
12 | });
13 |
14 | it('looks like the latest snapshot', async () => {
15 | await expect(element).shadowDom.to.equalSnapshot();
16 | });
17 | });
18 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/__snapshots__/CompasChangeSet.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-changeset-radiogroup looks like the latest snapshot"] =
5 | `
6 |
14 | [compas.changeset.major]
15 |
16 |
24 | [compas.changeset.minor]
25 |
26 |
34 | [compas.changeset.patch]
35 |
36 |
37 | `;
38 | /* end snapshot compas-changeset-radiogroup looks like the latest snapshot */
39 |
40 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/__snapshots__/CompasComment.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-comment looks like the latest snapshot"] =
5 | `
12 | `;
13 | /* end snapshot compas-comment looks like the latest snapshot */
14 |
15 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/__snapshots__/CompasImportFromApi.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-import-from-api looks like the latest snapshot"] =
5 | `
6 |
11 | cim-eq-hoorn-v3
12 |
13 |
18 | cim-eq-makkum
19 |
20 |
25 | cim-eq-winselingseweg-voorbeeld
26 |
27 |
32 | EQ-entsoe-voorbeeld
33 |
34 |
35 | `;
36 | /* end snapshot compas-import-from-api looks like the latest snapshot */
37 |
38 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/__snapshots__/CompasLoading.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-loading looks like the latest snapshot"] =
5 | `
6 |
11 |
12 | [compas.loading]
13 |
14 |
15 |
16 | `;
17 | /* end snapshot compas-loading looks like the latest snapshot */
18 |
19 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/compas/__snapshots__/CompasSessionExpiringDialog.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-session-expiring-dialog looks like the latest snapshot"] =
5 | `
10 |
11 | [compas.session.explainExpiring]
12 |
13 |
17 | [compas.session.continue]
18 |
19 |
20 | `;
21 | /* end snapshot compas-session-expiring-dialog looks like the latest snapshot */
22 |
23 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/menu/CompasOpen.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import CompasOpenMenuPlugin from '../../../src/menu/CompasOpen.js';
4 |
5 | describe('open-drawer', () => {
6 | if (customElements.get('compare-open-menu') === undefined)
7 | customElements.define('compare-open-menu', CompasOpenMenuPlugin);
8 |
9 | let plugin: CompasOpenMenuPlugin;
10 |
11 | beforeEach(async () => {
12 | plugin = await fixture(html` `);
13 | await plugin.updateComplete;
14 | });
15 |
16 | it('looks like the latest snapshot', async () => {
17 | await expect(plugin).shadowDom.to.equalSnapshot();
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/menu/__snapshots__/CompasCompareIED.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Compas Compare IED Plugin show template project selection dialog looks like its latest snapshot"] =
5 | `
6 |
7 |
8 |
14 |
15 |
16 | `;
17 | /* end snapshot Compas Compare IED Plugin show template project selection dialog looks like its latest snapshot */
18 |
19 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/menu/__snapshots__/CompasOpen.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-open-menu looks like the latest snapshot"] =
5 | `
9 |
10 |
11 |
18 |
19 |
20 | `;
21 | /* end snapshot compas-open-menu looks like the latest snapshot */
22 |
23 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/menu/__snapshots__/CompasSave.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-save-menu with no document loaded looks like the latest snapshot"] =
5 | `
9 |
10 |
11 |
12 | `;
13 | /* end snapshot compas-save-menu with no document loaded looks like the latest snapshot */
14 |
15 | snapshots["compas-save-menu with document loaded looks like the latest snapshot"] =
16 | `
20 |
21 |
22 |
28 |
29 |
36 |
37 |
38 | `;
39 | /* end snapshot compas-save-menu with document loaded looks like the latest snapshot */
40 |
41 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/menu/__snapshots__/CompasSaveAs.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["compas-save-menu with no document loaded looks like the latest snapshot"] =
5 | `
9 |
10 |
11 |
12 | `;
13 | /* end snapshot compas-save-menu with no document loaded looks like the latest snapshot */
14 |
15 | snapshots["compas-save-menu with document loaded looks like the latest snapshot"] =
16 | `
20 |
21 |
22 |
28 |
29 |
36 |
37 |
38 | `;
39 | /* end snapshot compas-save-menu with document loaded looks like the latest snapshot */
40 |
41 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/test/unit/wizards/compas-test-support.ts:
--------------------------------------------------------------------------------
1 | import { expect } from '@open-wc/testing';
2 |
3 | import {
4 | ComplexAction,
5 | isSimple
6 | } from '@openscd/core/foundation/deprecated/editor.js';
7 | import {
8 | WizardActor,
9 | WizardInputElement,
10 | } from '@openscd/open-scd/src/foundation.js';
11 |
12 | export function executeWizardComplexAction(
13 | wizardActor: WizardActor,
14 | wizard: Element,
15 | inputs: WizardInputElement[]
16 | ): ComplexAction {
17 | const complexActions = wizardActor(inputs, wizard);
18 | expect(complexActions.length).to.equal(1);
19 | expect(complexActions[0]).to.not.satisfy(isSimple);
20 | return complexActions[0];
21 | }
22 |
--------------------------------------------------------------------------------
/packages/compas-open-scd/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2020",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "noEmitOnError": true,
7 | "lib": ["es2020", "dom"],
8 | "strict": true,
9 | "esModuleInterop": false,
10 | "allowSyntheticDefaultImports": true,
11 | "experimentalDecorators": true,
12 | "importHelpers": true,
13 | "allowJs": true,
14 | "skipLibCheck": true,
15 | "outDir": "out-tsc",
16 | "sourceMap": true,
17 | "inlineSources": true,
18 | "resolveJsonModule": true,
19 | "rootDir": "./"
20 | },
21 | "include": ["**/*.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/core/.gitignore:
--------------------------------------------------------------------------------
1 | .tsbuildinfo
2 |
3 | dist/
4 | node_modules/
5 | doc/
6 |
--------------------------------------------------------------------------------
/packages/core/.npmignore:
--------------------------------------------------------------------------------
1 | ## editors
2 | /.idea
3 | /.vscode
4 |
5 | ## system files
6 | .DS_Store
7 |
8 | ## npm
9 | /node_modules/
10 | /npm-debug.log
11 |
12 | ## testing
13 | /coverage/
14 |
15 | ## local debug
16 | /.npmrc
17 |
18 | ## temp folders
19 | /.tmp/
20 |
21 | # build
22 | /_site/
23 | /out-tsc/
24 |
25 | storybook-static
26 | custom-elements.json
27 |
--------------------------------------------------------------------------------
/packages/core/demo/embedded.html:
--------------------------------------------------------------------------------
1 | OpenSCD Core Embedding Demo
2 |
3 |
17 |
--------------------------------------------------------------------------------
/packages/core/foundation/cyrb64.ts:
--------------------------------------------------------------------------------
1 | /**
2 | * Hashes `str` using the cyrb64 variant of
3 | * https://github.com/bryc/code/blob/master/jshash/experimental/cyrb53.js
4 | * @returns digest - a rather insecure hash, very quickly
5 | */
6 | export function cyrb64(str: string): string {
7 | /* eslint-disable no-bitwise */
8 | let h1 = 0xdeadbeef;
9 | let h2 = 0x41c6ce57;
10 | /* eslint-disable-next-line no-plusplus */
11 | for (let i = 0, ch; i < str.length; i++) {
12 | ch = str.charCodeAt(i);
13 | h1 = Math.imul(h1 ^ ch, 2654435761);
14 | h2 = Math.imul(h2 ^ ch, 1597334677);
15 | }
16 | h1 =
17 | Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^
18 | Math.imul(h2 ^ (h2 >>> 13), 3266489909);
19 | h2 =
20 | Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^
21 | Math.imul(h1 ^ (h1 >>> 13), 3266489909);
22 | return (
23 | (h2 >>> 0).toString(16).padStart(8, '0') +
24 | (h1 >>> 0).toString(16).padStart(8, '0')
25 | );
26 | /* eslint-enable no-bitwise */
27 | }
28 |
--------------------------------------------------------------------------------
/packages/core/foundation/deprecated/open-event.ts:
--------------------------------------------------------------------------------
1 | /** Represents a document to be opened. */
2 | export interface OpenDocDetail {
3 | doc: XMLDocument;
4 | docName: string;
5 | docId?: string;
6 | }
7 | export type OpenDocEvent = CustomEvent;
8 | export function newOpenDocEvent(
9 | doc: XMLDocument,
10 | docName: string,
11 | eventInitDict?: CustomEventInit>
12 | ): OpenDocEvent {
13 | return new CustomEvent('open-doc', {
14 | bubbles: true,
15 | composed: true,
16 | ...eventInitDict,
17 | detail: { doc, docName, ...eventInitDict?.detail },
18 | });
19 | }
20 |
21 | declare global {
22 | interface ElementEventMap {
23 | ['open-doc']: OpenDocEvent;
24 | }
25 | }
--------------------------------------------------------------------------------
/packages/core/foundation/deprecated/validation.ts:
--------------------------------------------------------------------------------
1 | /** Represents a request for validation. */
2 | export type ValidateEvent = CustomEvent;
3 | export function newValidateEvent(
4 | eventInitDict?: CustomEventInit
5 | ): ValidateEvent {
6 | return new CustomEvent('validate', {
7 | bubbles: true,
8 | composed: true,
9 | ...eventInitDict,
10 | });
11 | }
12 |
13 |
14 | declare global {
15 | interface ElementEventMap {
16 | ['validate']: ValidateEvent;
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/packages/core/foundation/deprecated/waiter.ts:
--------------------------------------------------------------------------------
1 | /** Represents some work pending completion, upon which `promise` resolves. */
2 | export interface PendingStateDetail {
3 | promise: Promise;
4 | }
5 | export type PendingStateEvent = CustomEvent;
6 |
7 | /**
8 | * @deprecated
9 | */
10 | export function newPendingStateEvent(
11 | promise: Promise,
12 | eventInitDict?: CustomEventInit>
13 | ): PendingStateEvent {
14 | return new CustomEvent('pending-state', {
15 | bubbles: true,
16 | composed: true,
17 | ...eventInitDict,
18 | detail: { promise, ...eventInitDict?.detail },
19 | });
20 | }
21 |
22 | declare global {
23 | interface ElementEventMap {
24 | ['pending-state']: PendingStateEvent;
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/packages/core/foundation/edit-completed-event.ts:
--------------------------------------------------------------------------------
1 | import { Edit, Initiator } from './deprecated/edit-event.js';
2 |
3 | import { EditorAction } from './deprecated/editor.js';
4 |
5 | export type EditCompletedDetail = {
6 | edit: Edit | EditorAction;
7 | initiator: Initiator;
8 | };
9 |
10 | /** Represents the intent to open `doc` with filename `docName`. */
11 | export type EditCompletedEvent = CustomEvent;
12 |
13 | export function newEditCompletedEvent(
14 | edit: Edit | EditorAction,
15 | initiator: Initiator = 'user'
16 | ): EditCompletedEvent {
17 | return new CustomEvent('oscd-edit-completed', {
18 | bubbles: true,
19 | composed: true,
20 | detail: {
21 | edit: edit,
22 | initiator: initiator,
23 | },
24 | });
25 | }
26 |
27 | declare global {
28 | interface ElementEventMap {
29 | ['oscd-edit-completed']: EditCompletedEvent;
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/packages/core/foundation/edit-event.ts:
--------------------------------------------------------------------------------
1 | import { EditV2 } from './edit.js';
2 |
3 | export type EditDetailV2 = EditEventOptionsV2 & {
4 | edit: E;
5 | };
6 |
7 | export type EditEventV2 = CustomEvent<
8 | EditDetailV2
9 | >;
10 |
11 | type BaseEditEventOptionsV2 = {
12 | title?: string;
13 | squash?: boolean;
14 | }
15 |
16 | export type EditEventOptionsV2 = BaseEditEventOptionsV2 & {
17 | createHistoryEntry?: boolean;
18 | };
19 |
20 | export function newEditEventV2(
21 | edit: E,
22 | options?: EditEventOptionsV2
23 | ): EditEventV2 {
24 | return new CustomEvent>('oscd-edit-v2', {
25 | composed: true,
26 | bubbles: true,
27 | detail: { ...options, edit },
28 | });
29 | }
30 |
31 | declare global {
32 | interface ElementEventMap {
33 | ['oscd-edit-v2']: EditEventV2;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/packages/core/foundation/open-event.ts:
--------------------------------------------------------------------------------
1 | export type OpenDetail = {
2 | doc: XMLDocument;
3 | docName: string;
4 | };
5 |
6 | /** Represents the intent to open `doc` with filename `docName`. */
7 | export type OpenEvent = CustomEvent;
8 |
9 | export function newOpenEvent(doc: XMLDocument, docName: string): OpenEvent {
10 | return new CustomEvent('oscd-open', {
11 | bubbles: true,
12 | composed: true,
13 | detail: { doc, docName },
14 | });
15 | }
16 |
17 | declare global {
18 | interface ElementEventMap {
19 | ['oscd-open']: OpenEvent;
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/packages/core/foundation/plugin.ts:
--------------------------------------------------------------------------------
1 | import { targetLocales } from '../locales.js';
2 |
3 | export type Plugin = {
4 | // name defines the name of the plugin
5 | name: string;
6 | // src defines the path to the plugins source file
7 | src: string;
8 | // kind defines the type of the plugin
9 | kind: PluginKind;
10 | // activeByDefault configures if the plugin should be active by default
11 | // this is will be user when users resets the plugins
12 | activeByDefault: boolean;
13 | // icon stores the icon name of the Material Icon
14 | icon?: string;
15 | // active shows if the plugin currently is active
16 | active?: boolean;
17 | // requireDoc shows if the plugin requires a document to be loaded
18 | requireDoc?: boolean;
19 | // position defines the position of menu plugins
20 | position?: MenuPosition
21 | translations?: Record<(typeof targetLocales)[number], string>;
22 | };
23 |
24 | export type PluginSet = { menu: Plugin[]; editor: Plugin[] };
25 | export type PluginKind = 'editor' | 'menu' | 'validator';
26 | export const menuPosition = ['top', 'middle', 'bottom'] as const;
27 | export type MenuPosition = (typeof menuPosition)[number];
28 |
29 |
--------------------------------------------------------------------------------
/packages/core/lit-localize.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "https://raw.githubusercontent.com/lit/lit/main/packages/localize-tools/config.schema.json",
3 | "sourceLocale": "en",
4 | "targetLocales": ["de"],
5 | "tsConfig": "./tsconfig.json",
6 | "output": {
7 | "mode": "runtime",
8 | "outputDir": "./locales",
9 | "localeCodesModule": "./locales.ts"
10 | },
11 | "interchange": {
12 | "format": "xliff",
13 | "xliffDir": "./localization/"
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/packages/core/locales.ts:
--------------------------------------------------------------------------------
1 | // Do not modify this file by hand!
2 | // Re-generate this file by running lit-localize.
3 |
4 | /**
5 | * The locale code that templates in this source code are written in.
6 | */
7 | export const sourceLocale = `en`;
8 |
9 | /**
10 | * The other locale codes that this application is localized into. Sorted
11 | * lexicographically.
12 | */
13 | export const targetLocales = [
14 | `de`,
15 | ] as const;
16 |
17 | /**
18 | * All valid project locale codes. Sorted lexicographically.
19 | */
20 | export const allLocales = [
21 | `de`,
22 | `en`,
23 | ] as const;
24 |
--------------------------------------------------------------------------------
/packages/core/locales/de.ts:
--------------------------------------------------------------------------------
1 |
2 | // Do not modify this file by hand!
3 | // Re-generate this file by running lit-localize
4 |
5 |
6 |
7 |
8 | /* eslint-disable no-irregular-whitespace */
9 | /* eslint-disable @typescript-eslint/no-explicit-any */
10 |
11 | export const templates = {
12 |
13 | };
14 |
--------------------------------------------------------------------------------
/packages/core/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@openscd/core",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/core/src",
6 | "targets": {}
7 | }
8 |
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/app-bar-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/app-bar-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/app-bar-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/app-bar-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/document-name-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/document-name-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/document-name-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/document-name-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/editor-plugins-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/editor-plugins-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/editor-plugins-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/editor-plugins-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/editor-plugins-selected-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/editor-plugins-selected-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/editor-plugins-selected-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/editor-plugins-selected-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/editor-plugins-with-doc-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/editor-plugins-with-doc-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/editor-plugins-with-doc-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/editor-plugins-with-doc-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-entries-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-entries-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-entries-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-entries-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-entries-redone-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-entries-redone-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-entries-redone-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-entries-redone-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-entries-undone-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-entries-undone-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-entries-undone-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-entries-undone-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-screen-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-screen-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/log-screen-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/log-screen-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/menu-drawer-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/menu-drawer-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/menu-drawer-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/menu-drawer-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/menu-plugins-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/menu-plugins-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/menu-plugins-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/menu-plugins-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/menu-plugins-triggered-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/menu-plugins-triggered-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Chromium/baseline/menu-plugins-triggered-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Chromium/baseline/menu-plugins-triggered-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/app-bar-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/app-bar-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/app-bar-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/app-bar-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/document-name-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/document-name-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/document-name-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/document-name-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/editor-plugins-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/editor-plugins-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/editor-plugins-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/editor-plugins-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/editor-plugins-selected-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/editor-plugins-selected-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/editor-plugins-selected-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/editor-plugins-selected-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/editor-plugins-with-doc-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/editor-plugins-with-doc-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/editor-plugins-with-doc-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/editor-plugins-with-doc-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-entries-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-entries-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-entries-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-entries-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-entries-redone-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-entries-redone-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-entries-redone-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-entries-redone-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-entries-undone-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-entries-undone-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-entries-undone-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-entries-undone-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-screen-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-screen-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/log-screen-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/log-screen-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/menu-drawer-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/menu-drawer-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/menu-drawer-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/menu-drawer-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/menu-plugins-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/menu-plugins-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/menu-plugins-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/menu-plugins-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/menu-plugins-triggered-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/menu-plugins-triggered-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Firefox/baseline/menu-plugins-triggered-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Firefox/baseline/menu-plugins-triggered-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/app-bar-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/app-bar-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/app-bar-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/app-bar-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/document-name-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/document-name-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/document-name-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/document-name-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/editor-plugins-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/editor-plugins-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/editor-plugins-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/editor-plugins-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/editor-plugins-selected-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/editor-plugins-selected-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/editor-plugins-selected-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/editor-plugins-selected-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/editor-plugins-with-doc-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/editor-plugins-with-doc-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/editor-plugins-with-doc-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/editor-plugins-with-doc-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-entries-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-entries-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-entries-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-entries-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-entries-redone-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-entries-redone-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-entries-redone-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-entries-redone-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-entries-undone-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-entries-undone-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-entries-undone-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-entries-undone-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-screen-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-screen-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/log-screen-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/log-screen-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/menu-drawer-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/menu-drawer-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/menu-drawer-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/menu-drawer-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/menu-plugins-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/menu-plugins-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/menu-plugins-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/menu-plugins-en.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/menu-plugins-triggered-de.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/menu-plugins-triggered-de.png
--------------------------------------------------------------------------------
/packages/core/screenshots/Webkit/baseline/menu-plugins-triggered-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/core/screenshots/Webkit/baseline/menu-plugins-triggered-en.png
--------------------------------------------------------------------------------
/packages/core/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2018",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "noEmitOnError": true,
7 | "lib": ["es2018", "dom"],
8 | "strict": true,
9 | "esModuleInterop": false,
10 | "allowSyntheticDefaultImports": true,
11 | "experimentalDecorators": true,
12 | "skipLibCheck": true,
13 | "declaration": true,
14 | "importHelpers": true,
15 | "outDir": "dist",
16 | "sourceMap": true,
17 | "inlineSources": true,
18 | "rootDir": "./",
19 | "tsBuildInfoFile": ".tsbuildinfo",
20 | "incremental": true
21 | },
22 | "include": ["**/*.ts"]
23 | }
24 |
--------------------------------------------------------------------------------
/packages/core/web-dev-server.config.js:
--------------------------------------------------------------------------------
1 | // import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
2 |
3 | /** Use Hot Module replacement by adding --hmr to the start command */
4 | const hmr = process.argv.includes('--hmr');
5 |
6 | export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
7 | open: '/demo/',
8 | /** Use regular watch mode if HMR is not enabled. */
9 | watch: !hmr,
10 | /** Resolve bare module imports */
11 | nodeResolve: {
12 | exportConditions: ['browser', 'development'],
13 | },
14 |
15 | /** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
16 | // esbuildTarget: 'auto'
17 |
18 | plugins: [
19 | /** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
20 | // hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
21 | ],
22 |
23 | // See documentation for all available options
24 | });
25 |
--------------------------------------------------------------------------------
/packages/distribution/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | module.exports = {
3 | root: true,
4 | parser: '@typescript-eslint/parser',
5 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc', 'import', 'html'],
6 | extends: [
7 | 'eslint:recommended',
8 | 'plugin:@typescript-eslint/eslint-recommended',
9 | 'plugin:@typescript-eslint/recommended',
10 | 'plugin:import/errors',
11 | 'plugin:import/warnings',
12 | ],
13 | rules: {
14 | // disable the rule for all files
15 | '@typescript-eslint/explicit-function-return-type': 'off',
16 | '@typescript-eslint/no-non-null-assertion': 'off',
17 | 'import/named': 'off',
18 | 'import/no-unresolved': 'off',
19 | 'import/extensions': ['error', 'always', { ignorePackages: true }],
20 | 'import/no-duplicates': 'off',
21 | 'no-duplicate-imports': 'off',
22 | 'tsdoc/syntax': 'warn'
23 | },
24 | };
25 |
--------------------------------------------------------------------------------
/packages/distribution/.gitignore:
--------------------------------------------------------------------------------
1 | ## editors
2 | /.idea
3 | /.vscode
4 |
5 | ## system files
6 | .DS_Store
7 |
8 | ## npm
9 | node_modules/
10 | /npm-debug.log
11 |
12 | ## testing
13 | /coverage/
14 | /**/dist/*.snap.dev.js
15 |
16 | ## docs
17 | /doc/
18 |
19 | # build
20 | /_site/
21 | /build/
22 | /out-tsc/
23 |
--------------------------------------------------------------------------------
/packages/distribution/.nojekyll:
--------------------------------------------------------------------------------
1 | snowpack placeholder
2 |
--------------------------------------------------------------------------------
/packages/distribution/browserconfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | #da532c
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/distribution/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/favicon.ico
--------------------------------------------------------------------------------
/packages/distribution/main.ts:
--------------------------------------------------------------------------------
1 | import '@openscd/open-scd/src/open-scd.js';
2 |
--------------------------------------------------------------------------------
/packages/distribution/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "short_name": "OpenSCD",
3 | "name": "OpenSCD",
4 | "description": "An editor for XML files as described by IEC 61850-6",
5 | "categories": [
6 | "productivity",
7 | "utilities",
8 | "engineering"
9 | ],
10 | "start_url": ".",
11 | "display": "standalone",
12 | "background_color": "#eee8d5",
13 | "theme_color": "#2aa198",
14 | "orientation": "any",
15 | "lang": "en-US",
16 | "dir": "ltr",
17 | "icons": [
18 | {
19 | "src": "public/icon.svg",
20 | "sizes": "150x150",
21 | "type": "image/svg+xml",
22 | "purpose": "any monochrome"
23 | },
24 | {
25 | "src": "public/icon-192x192.png",
26 | "sizes": "192x192",
27 | "type": "image/png",
28 | "purpose": "any"
29 | },
30 | {
31 | "src": "public/icon-512x512.png",
32 | "sizes": "512x512",
33 | "type": "image/png",
34 | "purpose": "any"
35 | },
36 | {
37 | "src": "public/maskable_icon.png",
38 | "sizes": "1024x1024",
39 | "type": "image/png",
40 | "purpose": "maskable"
41 | }
42 | ],
43 | "version": "0.36.0"
44 | }
45 |
--------------------------------------------------------------------------------
/packages/distribution/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@openscd/distribution",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "application",
5 | "sourceRoot": "packages/distribution/src",
6 | "targets": {}
7 | }
8 |
--------------------------------------------------------------------------------
/packages/distribution/public/apple-touch-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/apple-touch-icon.png
--------------------------------------------------------------------------------
/packages/distribution/public/favicon-16x16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/favicon-16x16.png
--------------------------------------------------------------------------------
/packages/distribution/public/favicon-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/favicon-32x32.png
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-mono-v13-latin-300.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-mono-v13-latin-300.ttf
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-mono-v13-latin-300.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-mono-v13-latin-300.woff
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-mono-v13-latin-300.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-mono-v13-latin-300.woff2
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-mono-v13.css:
--------------------------------------------------------------------------------
1 | /* roboto-mono-300 - latin */
2 | @font-face {
3 | font-family: 'Roboto Mono';
4 | font-style: normal;
5 | font-weight: 300;
6 | src: local(''),
7 | url('roboto-mono-v13-latin-300.woff2') format('woff2'), /* Super Modern Browsers */
8 | url('roboto-mono-v13-latin-300.woff') format('woff'), /* Modern Browsers */
9 | url('roboto-mono-v13-latin-300.ttf') format('truetype'); /* Safari, Android, iOS */
10 | }
11 |
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-300.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-300.ttf
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-300.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-300.woff
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-300.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-300.woff2
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-500.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-500.ttf
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-500.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-500.woff
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-500.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-500.woff2
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-regular.ttf
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-regular.woff
--------------------------------------------------------------------------------
/packages/distribution/public/google/fonts/roboto-v27-latin-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/fonts/roboto-v27-latin-regular.woff2
--------------------------------------------------------------------------------
/packages/distribution/public/google/icons/material-icons-outlined.css:
--------------------------------------------------------------------------------
1 | /* fallback */
2 | @font-face {
3 | font-family: 'Material Icons Outlined';
4 | font-style: normal;
5 | font-weight: 400;
6 | font-display: block;
7 | src: url(material-icons-outlined.woff2) format('woff2');
8 | }
9 |
10 | .material-icons-outlined {
11 | font-family: 'Material Icons Outlined';
12 | font-weight: normal;
13 | font-style: normal;
14 | font-size: 24px;
15 | line-height: 1;
16 | letter-spacing: normal;
17 | text-transform: none;
18 | display: inline-block;
19 | white-space: nowrap;
20 | word-wrap: normal;
21 | direction: ltr;
22 | -webkit-font-feature-settings: 'liga';
23 | -webkit-font-smoothing: antialiased;
24 | }
25 |
--------------------------------------------------------------------------------
/packages/distribution/public/google/icons/material-icons-outlined.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/icons/material-icons-outlined.woff2
--------------------------------------------------------------------------------
/packages/distribution/public/google/icons/material-symbols-outlined.css:
--------------------------------------------------------------------------------
1 | /* fallback */
2 | @font-face {
3 | font-family: 'Material Symbols Outlined';
4 | font-style: normal;
5 | font-weight: 400;
6 | font-display: block;
7 | src: url(material-symbols-outlined.woff2) format('woff2');
8 | }
9 |
10 | .material-symbols-outlined {
11 | font-family: 'Material Symbols Outlined';
12 | font-weight: normal;
13 | font-style: normal;
14 | font-size: 24px;
15 | line-height: 1;
16 | letter-spacing: normal;
17 | text-transform: none;
18 | display: inline-block;
19 | white-space: nowrap;
20 | word-wrap: normal;
21 | direction: ltr;
22 | -webkit-font-feature-settings: 'liga';
23 | -webkit-font-smoothing: antialiased;
24 | }
25 |
--------------------------------------------------------------------------------
/packages/distribution/public/google/icons/material-symbols-outlined.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/google/icons/material-symbols-outlined.woff2
--------------------------------------------------------------------------------
/packages/distribution/public/icon-192x192.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/icon-192x192.png
--------------------------------------------------------------------------------
/packages/distribution/public/icon-512x512.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/icon-512x512.png
--------------------------------------------------------------------------------
/packages/distribution/public/icon.svg:
--------------------------------------------------------------------------------
1 |
2 |
7 |
14 |
18 |
19 |
--------------------------------------------------------------------------------
/packages/distribution/public/js/worker.js:
--------------------------------------------------------------------------------
1 | importScripts('xmlvalidate.js');
2 |
3 | onmessage = function (e) {
4 | Module.ready.then(function (mod) {
5 | if (e.data.name.toLowerCase().endsWith('.xsd'))
6 | mod.init(e.data.content, e.data.name);
7 | else mod.validate(e.data.content, e.data.name);
8 | });
9 | };
10 |
--------------------------------------------------------------------------------
/packages/distribution/public/js/xmlvalidate.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/js/xmlvalidate.wasm
--------------------------------------------------------------------------------
/packages/distribution/public/maskable_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/maskable_icon.png
--------------------------------------------------------------------------------
/packages/distribution/public/monochrome_icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/monochrome_icon.png
--------------------------------------------------------------------------------
/packages/distribution/public/mstile-144x144.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/mstile-144x144.png
--------------------------------------------------------------------------------
/packages/distribution/public/mstile-150x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/mstile-150x150.png
--------------------------------------------------------------------------------
/packages/distribution/public/mstile-310x150.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/mstile-310x150.png
--------------------------------------------------------------------------------
/packages/distribution/public/mstile-310x310.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/mstile-310x310.png
--------------------------------------------------------------------------------
/packages/distribution/public/mstile-70x70.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/mstile-70x70.png
--------------------------------------------------------------------------------
/packages/distribution/public/xml/CC-EULA.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/distribution/public/xml/CC-EULA.pdf
--------------------------------------------------------------------------------
/packages/distribution/snowpack.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | packageOptions: {
3 | external: [
4 | '@web/dev-server-core',
5 | '@web/dev-server-esbuild',
6 | 'esbuild',
7 | 'crypto',
8 | ],
9 | },
10 | exclude: [
11 | '**/*.@(spec|test).@(js|mjs)',
12 | '**/test/**/*',
13 | '**/out-tsc/**/*',
14 | '**/.editorconfig',
15 | '**/.eslintrc.cjs',
16 | '**/.git/**/*',
17 | '**/.gitignore',
18 | '**/.idea/**/*',
19 | '**/.travis.yml',
20 | '**/package*',
21 | '**/tsconfig.json',
22 | '**/web-test-runner.config.mjs',
23 | '**/node_modules/**/*',
24 | ],
25 | workspaceRoot: '../../',
26 | mount: {
27 | './': '/',
28 | '../plugins/': '/plugins/',
29 | '../openscd/': '/openscd/',
30 | },
31 | alias: {
32 | '@openscd/open-scd': '../openscd/',
33 | '@openscd/plugins': '../plugins/',
34 | },
35 | buildOptions: {
36 | baseUrl: process.env.PUBLIC_URL || '/',
37 | },
38 | };
39 |
--------------------------------------------------------------------------------
/packages/distribution/sw.js:
--------------------------------------------------------------------------------
1 | self.addEventListener('install', e => {
2 | console.log('Dev (dummy, non-caching) service worker installed');
3 | });
4 |
5 | self.addEventListener('fetch', e => {
6 | e.respondWith(fetch(e.request));
7 | });
8 |
9 | self.addEventListener('activate', e => {
10 | console.log('Dev (dummy, non-caching) service worker activated');
11 | });
12 |
--------------------------------------------------------------------------------
/packages/distribution/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2020",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "noEmitOnError": true,
7 | "lib": ["es2020", "dom"],
8 | "strict": true,
9 | "esModuleInterop": false,
10 | "allowSyntheticDefaultImports": true,
11 | "experimentalDecorators": true,
12 | "importHelpers": true,
13 | "allowJs": true,
14 | "skipLibCheck": true,
15 | "outDir": "out-tsc",
16 | "sourceMap": true,
17 | "inlineSources": true,
18 | "resolveJsonModule": true,
19 | "rootDir": "./"
20 | },
21 | "include": ["**/*.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/distribution/workbox-config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | globDirectory: 'build/',
3 | globPatterns: [
4 | 'public/**/*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}',
5 | 'src/**/*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}',
6 | '*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}',
7 | ],
8 | swDest: 'build/sw.js',
9 | runtimeCaching: [
10 | {
11 | urlPattern: /.*/,
12 | handler: 'NetworkFirst',
13 | },
14 | ],
15 | skipWaiting: true,
16 | inlineWorkboxRuntime: true,
17 | };
18 |
--------------------------------------------------------------------------------
/packages/openscd/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | module.exports = {
3 | root: true,
4 | parser: '@typescript-eslint/parser',
5 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc', 'import', 'html'],
6 | extends: [
7 | 'eslint:recommended',
8 | 'plugin:@typescript-eslint/eslint-recommended',
9 | 'plugin:@typescript-eslint/recommended',
10 | 'plugin:import/errors',
11 | 'plugin:import/warnings',
12 | ],
13 | rules: {
14 | // disable the rule for all files
15 | '@typescript-eslint/explicit-function-return-type': 'off',
16 | '@typescript-eslint/no-non-null-assertion': 'off',
17 | 'import/named': 'off',
18 | 'import/no-unresolved': 'off',
19 | 'import/extensions': ['error', 'always', { ignorePackages: true }],
20 | 'import/no-duplicates': 'off',
21 | 'no-duplicate-imports': 'off',
22 | 'tsdoc/syntax': 'warn'
23 | },
24 | env: {
25 | browser: true,
26 | },
27 | };
28 |
--------------------------------------------------------------------------------
/packages/openscd/.gitignore:
--------------------------------------------------------------------------------
1 | ## editors
2 | /.idea
3 | /.vscode
4 |
5 | ## system files
6 | .DS_Store
7 |
8 | ## npm
9 | node_modules/
10 | /npm-debug.log
11 |
12 | ## testing
13 | /coverage/
14 | /**/dist/*.snap.dev.js
15 |
16 | ## docs
17 | /doc/
18 |
19 | # build
20 | /_site/
21 | /build/
22 | /dist/
23 |
--------------------------------------------------------------------------------
/packages/openscd/.nojekyll:
--------------------------------------------------------------------------------
1 | snowpack placeholder
2 |
--------------------------------------------------------------------------------
/packages/openscd/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/openscd/favicon.ico
--------------------------------------------------------------------------------
/packages/openscd/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@openscd/open-scd",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "application",
5 | "sourceRoot": "packages/openscd/src",
6 | "targets": {
7 | }
8 | }
9 |
--------------------------------------------------------------------------------
/packages/openscd/public/md/Add-DAType-from-templates.md:
--------------------------------------------------------------------------------
1 | As an example this page shows you how to import `DAType` from the templates database. E.g. the `PulseConfig`.
2 |
3 | 1. Open **Template editor**
4 | 2. Click the **Add DAType** button
5 | 3. Select *PulseConfig* from **values**
6 | 4. Don't forget the **id** field
7 | 6. Click on **Save**
8 |
9 | OpenSCD automatically imports all element that are required for a valid definition of a `DAType`. When you do that with an empty project your result should look like this
10 |
11 | 
--------------------------------------------------------------------------------
/packages/openscd/public/md/Add-DOType-from-templates.md:
--------------------------------------------------------------------------------
1 | As an example this page shows you how to import `DOType` from the templates database.
2 |
3 | 1. Open **Template editor**
4 | 2. Click the **Add DOType** button
5 | 3. Select *DPC* from **values**
6 | 4. Don't forget the **id** field
7 | 6. Click on **Save**
8 |
9 | OpenSCD automatically imports all element that are required for a valid definition of a `DOType`. When you do that with an empty project your result should look like this
10 |
11 | 
--------------------------------------------------------------------------------
/packages/openscd/public/md/Add-LNodeType-from-templates.md:
--------------------------------------------------------------------------------
1 | As an example this page shows you how to import a `LNodeType` `CSWI` from the templates database.
2 |
3 | 1. Open **Template editor**
4 | 2. Click the **Add LNodeType** button
5 | 3. Select pre-defined logical node class e.g. _CSWI: ... no process bus(PB)_ as **lnClass**
6 | 4. Don't forget the **id** field
7 | 5. Click on **Save**
8 |
9 | OpenSCD automatically imports all element that are required for a valid definition of a `LNodeType` `CSWI`. When you do that with an empty project your result should look like this
10 |
11 | 
12 |
--------------------------------------------------------------------------------
/packages/openscd/public/md/All-template-editor-wizards.md:
--------------------------------------------------------------------------------
1 | The **template editor** allows you to create the elements that combined is the data model. To do this job there are 10 wizards pages for each of the elements you can find in the `DataTypeTemplates` section.
2 |
3 | - [EnumType](https://github.com/openscd/open-scd/wiki/Enumeration-EnumType)
4 | - [EnumVal](https://github.com/openscd/open-scd/wiki/Enumeration-EnumVal)
5 |
--------------------------------------------------------------------------------
/packages/openscd/public/md/Extensions.md:
--------------------------------------------------------------------------------
1 | OpenSCD uses extensions to provide built-in functionality and to allow additional functionality beyond the OpenSCD defaults.
2 |
3 | Utilities, IED manufacturers, system integrators or other parties can create extensions and provide an interface for viewing or modifying SCL (including modification of private namespaces).
4 |
5 | There are three types of extensions:
6 |
7 | 1. _Menu_ extensions - shown on the project menu after enabling them.
8 | 2. _Editor_ extensions - shown in the main window after enabling them.
9 | 3. _Validator_ extensions - ensure file compliance with a schema or design rules.
10 |
11 | To enable extensions, open the project menu by clicking on the top three lines in the top left, scrolling to the bottom and selecting the _Extensions_ item.
12 | Then select and deselect functionality.
13 | If you are confident in the source of a custom extension, you can also add an extension from a URL.
14 |
15 | > NOTE: Infrequently used or in-development extensions are disabled by default.
16 |
17 | > NOTE: Where there are many editor extensions, scroll through them by using Shift + Wheel Mouse button.
18 |
--------------------------------------------------------------------------------
/packages/openscd/public/md/Global-SCL-manipulation.md:
--------------------------------------------------------------------------------
1 | This page explains with features that are not related to a specific process within a SCL. They have a global character and can be used for a lot of different task. At the moment these is a
2 |
3 | - [Merge functionality](https://github.com/openscd/open-scd/wiki/Merge-functionality)
4 | - [XML editor](https://github.com/openscd/open-scd/wiki/XML-code-editor) - pro mode
--------------------------------------------------------------------------------
/packages/openscd/public/md/IED.md:
--------------------------------------------------------------------------------
1 | Here you can learn how to configure `IED`s with **OpenSCD**.
2 |
3 | ## Create virtual IED
4 |
5 | - [Create SPECIFICATION IED](https://github.com/openscd/open-scd/wiki/Create-Specification-IED-from-functions)
6 |
7 | ## Edit/create/delete control blocks
8 |
9 | - [GSEControl](https://github.com/openscd/open-scd/wiki/Generic-Substation-Event-Basics) (`GOOSE`)
10 | - [SampledValueControl](https://github.com/openscd/open-scd/wiki/Sampled-Values-Basics)
11 | - [ReportControl](https://github.com/openscd/open-scd/wiki/Report-Basics)
12 |
13 | ## Communication mappings
14 |
15 | - [Create report connections](https://github.com/openscd/open-scd/wiki/ClientLN) (`ClientLN`)
16 | - [Create GOOSE connection](https://github.com/openscd/open-scd/wiki/Subscriber-basics)
17 | - [Create Sampled Value connections](https://github.com/openscd/open-scd/wiki/Subscriber-basics)
18 |
--------------------------------------------------------------------------------
/packages/openscd/public/md/Interface.md:
--------------------------------------------------------------------------------
1 | OpenSCD makes extensive use of lists which allow filtering by a search query.
2 |
3 | You can use wildcards as part of a search query:
4 |
5 | * A question mark, `?` will match any single character
6 | * An asterisk, `*` will match one or more characters
7 |
--------------------------------------------------------------------------------
/packages/openscd/public/md/Save-project.md:
--------------------------------------------------------------------------------
1 | One of the things that user might be different in OpenSCD compared to a desktop application is **Save project**. As OpenSCD runs in the browser we use the browser standard behavior to save files and in most browsers this means that the file is downloaded in the download folder on your machine directly.
2 |
3 | HOWEVER, you can change this standard behavior. In Chrome and Chromium, this setting is called **Ask where to save each file before downloading**.
--------------------------------------------------------------------------------
/packages/openscd/public/md/Validate-schema.md:
--------------------------------------------------------------------------------
1 | Schema validation is the most important validation tool. It is crucial to make sure that there are no schema related issues latest on saving the project, as the schema defines the SCL structure it therefore ensures interoperability and should be a minimal requirement.
2 |
3 | Under the hood we are using the industry standard to do schema validation [libxml2](https://en.wikipedia.org/wiki/Libxml2). The external library can be used by other web based tools as well. We have create another repository [xmlvalidate.js](https://github.com/openscd/xmlvalidate.js) that allows you to use the schema validation.
4 |
5 | The results/issues are show in the **diagnostics** pane and als important when there are no issues and the schema validation is successful. This at the end what you want to see :).
--------------------------------------------------------------------------------
/packages/openscd/public/md/Validators.md:
--------------------------------------------------------------------------------
1 | Validators are the backbone of this editor. It is very tricky to handle the complexity of an SCL file without it. This is especially true for people just working with SCL files and OpenSCD. In most cases, we try to avoid producing invalid files, but especially in **expert mode**, it is not always possible.
2 |
3 | There are two validation functions implemented at the moment. Both are triggered on opening an project or creating a new project. So every time the project basis change. And all validators are triggered on every editor action. That means every time there are changes in the project basis. All results are displayed in the **diagnostics** pane (Ctrl D) and are group by the validation function
4 |
5 |
6 | 1. [Schema validator](https://github.com/openscd/open-scd/wiki/Validate-schema)
7 | 2. [Templates validator](https://github.com/openscd/open-scd/wiki/Validate-template)
--------------------------------------------------------------------------------
/packages/openscd/public/md/XML-code-editor.md:
--------------------------------------------------------------------------------
1 |
2 | With **OpenSCD** elements are manipulated with so-called wizard pages. If such a page has not been created yet for an element you want to manipulate or you just are curious how this element looks like in the XML we have added a **pro mode** that you can select in **Settings**
3 |
4 |
5 |
6 | 1. Open **Menu**
7 | 2. Click on **Setting**
8 | 3. Click on switch **pro mode**
9 |
10 |
11 |
12 | Once this is done you can open any wizard page e.g. **Edit Substation**. You can see a toggle button on the upper right corner. If you click this toggle button the wizard page disappears and the XML code editor appear containing the element in raw XML.
13 |
14 | 
15 |
16 | > NOTE: This is a feature for experienced users. You can also use this feature to change SCL content. Behind the scenes the element will be exchanged completely with the updated version. Of course you can undo anytime.
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/packages/openscd/public/xml/CC-EULA.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/openscd/public/xml/CC-EULA.pdf
--------------------------------------------------------------------------------
/packages/openscd/src/WizardDivider.ts:
--------------------------------------------------------------------------------
1 | import {
2 | css,
3 | customElement,
4 | html,
5 | LitElement,
6 | property,
7 | TemplateResult,
8 | } from 'lit-element';
9 |
10 | @customElement('wizard-divider')
11 | export class WizardDividerElement extends LitElement {
12 | @property({
13 | type: String,
14 | })
15 | header?: string;
16 |
17 | render(): TemplateResult {
18 | return html` ${this.renderHeader()} ${this.renderSeparator()}`;
19 | }
20 |
21 | private renderHeader(): TemplateResult {
22 | if (!this.header) {
23 | return html``;
24 | }
25 |
26 | return html``;
27 | }
28 |
29 | private renderSeparator(): TemplateResult {
30 | return html`
`;
31 | }
32 |
33 | static styles = css`
34 | div {
35 | height: 0px;
36 | margin: 10px 0px 10px 0px;
37 | border-top: none;
38 | border-right: none;
39 | border-left: none;
40 | border-image: initial;
41 | border-bottom: 1px solid rgba(0, 0, 0, 0.12);
42 | }
43 | `;
44 | }
45 |
--------------------------------------------------------------------------------
/packages/openscd/src/foundation/nsd.ts:
--------------------------------------------------------------------------------
1 | export const iec6185074 = fetch('public/xml/IEC_61850-7-4_2007B3.nsd')
2 | .then(response => response.text())
3 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
4 |
5 | export const iec6185073 = fetch('public/xml/IEC_61850-7-3_2007B3.nsd')
6 | .then(response => response.text())
7 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
8 |
9 | export const iec6185072 = fetch('public/xml/IEC_61850-7-2_2007B3.nsd')
10 | .then(response => response.text())
11 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
12 |
13 | export const iec6185081 = fetch('public/xml/IEC_61850-8-1_2003A2.nsd')
14 | .then(response => response.text())
15 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
--------------------------------------------------------------------------------
/packages/openscd/src/icons/compare.ts:
--------------------------------------------------------------------------------
1 | import { svg } from "lit-html";
2 |
3 | export const elementIcon = svg`
4 |
5 | `;
6 |
7 | export const attributeIcon = svg`
8 |
9 | `;
10 |
11 | export const contentIcon = svg`
12 |
13 | `;
14 |
--------------------------------------------------------------------------------
/packages/openscd/src/plugin.events.ts:
--------------------------------------------------------------------------------
1 | import { Plugin, PluginKind } from './plugin.js';
2 |
3 | /**
4 | * The configure plugin event allows the plugin to request that OpenSCD core add, remove, or reconfigure a plugin.
5 | */
6 | export type ConfigurePluginDetail = {
7 | name: string;
8 | // The API describes only 'menu' and 'editor' kinds b
9 | // but we still use the 'validator' too, so I just use the type PluginKind
10 | kind: PluginKind;
11 | config: Plugin | null;
12 | };
13 |
14 | export type ConfigurePluginEvent = CustomEvent;
15 |
16 | /**
17 | * The combination of name and kind uniquely identifies the plugin to be configured.
18 | * If config is null, the plugin is removed. Otherwise, the plugin is added or reconfigured.
19 | */
20 | export function newConfigurePluginEvent(name: string, kind: PluginKind, config: Plugin | null): ConfigurePluginEvent {
21 | return new CustomEvent('oscd-configure-plugin', {
22 | bubbles: true,
23 | composed: true,
24 | detail: { name, kind, config },
25 | });
26 | }
27 |
--------------------------------------------------------------------------------
/packages/openscd/src/plugin.ts:
--------------------------------------------------------------------------------
1 | import { TemplateResult } from 'lit-element';
2 | import { Plugin as CorePlugin } from "@openscd/core"
3 |
4 | export type Plugin = CorePlugin & {
5 | official?: boolean;
6 | active: boolean;
7 | content?: () => TemplateResult;
8 | };
9 |
10 | export type PluginConfig = PluginConfigNotMenu | PluginConfigMenu
11 |
12 | export type PluginConfigNotMenu = Omit & {
13 | kind: 'editor' | 'validator';
14 | }
15 |
16 | export type PluginConfigMenu = Omit & {
17 | kind: 'menu';
18 | position: MenuPosition;
19 | }
20 |
21 | export type InstalledOfficialPlugin = Plugin & {
22 | src: string;
23 | official: true;
24 | installed: boolean;
25 | };
26 |
27 | export type PluginKind = 'editor' | 'menu' | 'validator';
28 | export const menuPosition = ['top', 'middle', 'bottom'] as const;
29 | export type MenuPosition = (typeof menuPosition)[number];
30 |
31 |
--------------------------------------------------------------------------------
/packages/openscd/src/translations/loader.ts:
--------------------------------------------------------------------------------
1 | import { Strings } from 'lit-translate';
2 | import { de } from './de.js';
3 | import { en } from './en.js';
4 | import { Language } from '@openscd/core/foundation/deprecated/settings.js';
5 | export const languages = { en, de };
6 |
7 | export type Translations = typeof en;
8 |
9 | export async function loader(lang: string): Promise {
10 | if (Object.keys(languages).includes(lang)) return languages[lang];
11 | else return {};
12 | }
13 |
--------------------------------------------------------------------------------
/packages/openscd/test/mock-edits.ts:
--------------------------------------------------------------------------------
1 | import { Edit, Insert, Remove, Update } from '@openscd/core';
2 |
3 |
4 | const element = document.createElement('test-element');
5 | const parent = document.createElement('test-parent');
6 | const reference = document.createElement('test-sibling');
7 |
8 | parent.appendChild(element);
9 | parent.appendChild(reference);
10 |
11 | export const mockEdits = {
12 | insert: (): Insert => ({ parent, node: element, reference }),
13 | remove: (): Remove => ({ node: element }),
14 | update: (): Update => ({ element, attributes: { test: 'value' } }),
15 | complex: (): Edit[] => [ mockEdits.insert(), mockEdits.remove(), mockEdits.update() ],
16 | }
17 |
--------------------------------------------------------------------------------
/packages/openscd/test/testfiles/foundation/testFile73.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/openscd/test/testfiles/foundation/testFile74.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/openscd/test/testfiles/foundation/testFile81.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/openscd/test/testfiles/nsdoc/IEC_61850-7-2.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/openscd/test/testfiles/nsdoc/invalid.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/openscd/test/testfiles/nsdoc/wrong-version.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/__snapshots__/action-icon.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Basic component action-icon with icon property set looks like the latest snapshot"] =
5 | `
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
17 | `;
18 | /* end snapshot Basic component action-icon with icon property set looks like the latest snapshot */
19 |
20 | snapshots["Basic component action-icon with unset icon property looks like the latest snapshot"] =
21 | `
23 |
24 |
25 |
26 |
27 | edit
28 |
29 |
30 |
31 |
32 |
33 |
34 |
36 | `;
37 | /* end snapshot Basic component action-icon with unset icon property looks like the latest snapshot */
38 |
39 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/__snapshots__/action-pane.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["action-pane looks like the latest snapshot"] =
5 | `
6 |
7 |
8 |
9 |
10 |
11 | test label
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 | `;
23 | /* end snapshot action-pane looks like the latest snapshot */
24 |
25 | snapshots["action-pane with icon property set looks like the latest snapshot"] =
26 | `
27 |
28 |
29 |
30 |
31 | edit
32 |
33 |
34 |
35 | test label
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | `;
47 | /* end snapshot action-pane with icon property set looks like the latest snapshot */
48 |
49 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/__snapshots__/filtered-list.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["filtered-list looks like its latest snapshot"] =
5 | `
6 |
7 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
26 | `;
27 | /* end snapshot filtered-list looks like its latest snapshot */
28 |
29 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/action-icon.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import '../../src/action-icon.js';
4 | import { ActionIcon } from '../../src/action-icon.js';
5 |
6 | describe('Basic component action-icon', () => {
7 | let element: ActionIcon;
8 |
9 | beforeEach(async () => {
10 | element = await fixture(
11 | html` `
12 | );
13 | await element.updateComplete;
14 | });
15 | describe('with icon property set', () => {
16 | it('looks like the latest snapshot', async () => {
17 | await expect(element).shadowDom.to.equalSnapshot();
18 | });
19 | });
20 |
21 | describe('with unset icon property ', () => {
22 | beforeEach(async () => {
23 | element.icon = 'edit';
24 | await element.requestUpdate();
25 | });
26 | it('looks like the latest snapshot', async () => {
27 | await expect(element).shadowDom.to.equalSnapshot();
28 | });
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/mock-actions.ts:
--------------------------------------------------------------------------------
1 | import { ComplexAction, SimpleAction } from '@openscd/core/foundation/deprecated/editor.js';
2 |
3 | const element = document.createElement('test-element');
4 | const parent = document.createElement('test-parent');
5 | const reference = document.createElement('test-sibling');
6 |
7 | parent.appendChild(element);
8 | parent.appendChild(reference);
9 |
10 | export class MockAction {
11 | static get cre(): SimpleAction {
12 | return { new: { parent, element, reference } };
13 | }
14 | static get del(): SimpleAction {
15 | return { old: { parent, element, reference } };
16 | }
17 | static get mov(): SimpleAction {
18 | return { old: { parent, element, reference }, new: { parent, reference } };
19 | }
20 | static get upd(): SimpleAction {
21 | return { old: { element }, new: { element } };
22 | }
23 | static get complex(): ComplexAction {
24 | return {
25 | actions: [MockAction.cre, MockAction.del, MockAction.mov, MockAction.upd],
26 | title: 'Test complex EditorAction',
27 | };
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/mock-document.ts:
--------------------------------------------------------------------------------
1 | export function mockSCD(): XMLDocument {
2 | return new DOMParser().parseFromString(
3 | `
4 |
5 |
6 |
7 |
8 |
9 |
10 | `,
11 | 'application/xml'
12 | );
13 | }
14 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/mock-editor.ts:
--------------------------------------------------------------------------------
1 | import { LitElement, customElement } from 'lit-element';
2 | import { Editing } from '../../src/Editing.js';
3 |
4 | @customElement('mock-editor')
5 | export class MockEditor extends Editing(LitElement) {}
6 |
--------------------------------------------------------------------------------
/packages/openscd/test/unit/schema.test.ts:
--------------------------------------------------------------------------------
1 | import {expect} from "@open-wc/testing";
2 |
3 | import {isSCLNamespace, SCL_NAMESPACE} from "../../src/schemas.js";
4 |
5 | describe('schema', () => {
6 | it('when element belongs to SCL Namespace, function should return true', () => {
7 | const doc = document.implementation.createDocument(SCL_NAMESPACE, null, null);
8 | const element = doc.createElementNS(SCL_NAMESPACE, "SCL");
9 |
10 | expect(isSCLNamespace(element)).to.be.true;
11 | });
12 |
13 | it('when element not belonging to SCL Namespace, function should return false', () => {
14 | const doc = document.implementation.createDocument(SCL_NAMESPACE, null, null);
15 | const element = doc.createElementNS("https://someother.namespace.com", "SCL");
16 |
17 | expect(isSCLNamespace(element)).to.be.false;
18 | });
19 | });
20 |
--------------------------------------------------------------------------------
/packages/openscd/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2020",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "noEmitOnError": true,
7 | "lib": ["es2020", "dom"],
8 | "strict": true,
9 | "esModuleInterop": false,
10 | "allowSyntheticDefaultImports": true,
11 | "experimentalDecorators": true,
12 | "importHelpers": true,
13 | "allowJs": true,
14 | "skipLibCheck": true,
15 | "outDir": "./dist",
16 | "sourceMap": true,
17 | "inlineSources": true,
18 | "resolveJsonModule": true,
19 | "rootDir": "./src"
20 | },
21 | "include": ["./src/**/*.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/plugins/.eslintrc.cjs:
--------------------------------------------------------------------------------
1 | /* eslint-env node */
2 | module.exports = {
3 | root: true,
4 | parser: '@typescript-eslint/parser',
5 | plugins: ['@typescript-eslint', 'eslint-plugin-tsdoc', 'import', 'html'],
6 | extends: [
7 | 'eslint:recommended',
8 | 'plugin:@typescript-eslint/eslint-recommended',
9 | 'plugin:@typescript-eslint/recommended',
10 | 'plugin:import/errors',
11 | 'plugin:import/warnings',
12 | ],
13 | rules: {
14 | // disable the rule for all files
15 | '@typescript-eslint/explicit-function-return-type': 'off',
16 | '@typescript-eslint/no-non-null-assertion': 'off',
17 | 'import/named': 'off',
18 | 'import/no-unresolved': 'off',
19 | 'import/extensions': ['error', 'always', { ignorePackages: true }],
20 | 'import/no-duplicates': 'off',
21 | 'no-duplicate-imports': 'off',
22 | 'tsdoc/syntax': 'warn'
23 | },
24 | };
25 |
--------------------------------------------------------------------------------
/packages/plugins/.gitignore:
--------------------------------------------------------------------------------
1 | ## editors
2 | /.idea
3 | /.vscode
4 |
5 | ## system files
6 | .DS_Store
7 |
8 | ## npm
9 | node_modules/
10 | /npm-debug.log
11 |
12 | ## testing
13 | /coverage/
14 | /**/dist/*.snap.dev.js
15 |
16 | ## docs
17 | /doc/
18 |
19 | # build
20 | /_site/
21 | /build/
22 | /dist/
23 |
--------------------------------------------------------------------------------
/packages/plugins/.nojekyll:
--------------------------------------------------------------------------------
1 | snowpack placeholder
2 |
--------------------------------------------------------------------------------
/packages/plugins/README.md:
--------------------------------------------------------------------------------
1 | # `OpenSCD Official Plug-ins`
2 |
3 | All the offical plug-ins are listed [here](https://github.com/openscd/open-scd/blob/main/docs/plug-ins.md)
4 |
--------------------------------------------------------------------------------
/packages/plugins/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@openscd/plugins",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/plugins/src",
6 | "targets": {
7 | }
8 |
9 | }
10 |
--------------------------------------------------------------------------------
/packages/plugins/public/js/worker.js:
--------------------------------------------------------------------------------
1 | importScripts('xmlvalidate.js');
2 |
3 | onmessage = function(e) {
4 | Module.ready.then(function(mod) {
5 | if (e.data.name.toLowerCase().endsWith('.xsd'))
6 | mod.init(e.data.content, e.data.name);
7 | else mod.validate(e.data.content, e.data.name);
8 | });
9 | };
10 |
--------------------------------------------------------------------------------
/packages/plugins/public/js/xmlvalidate.wasm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/plugins/public/js/xmlvalidate.wasm
--------------------------------------------------------------------------------
/packages/plugins/public/xml/CC-EULA.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/com-pas/compas-open-scd/88ba11e9565f167ba1cf4b9a37efeab253b82dbc/packages/plugins/public/xml/CC-EULA.pdf
--------------------------------------------------------------------------------
/packages/plugins/snowpack.config.mjs:
--------------------------------------------------------------------------------
1 | export default {
2 | plugins: ['@snowpack/plugin-typescript'],
3 | packageOptions: {
4 | external: [
5 | '@web/dev-server-core',
6 | '@web/dev-server-esbuild',
7 | 'esbuild',
8 | 'crypto',
9 | ],
10 | },
11 | exclude: [
12 | '**/*.@(spec|test).@(js|mjs)',
13 | '**/test/**/*',
14 | '**/out-tsc/**/*',
15 | '**/.editorconfig',
16 | '**/.eslintrc.cjs',
17 | '**/.git/**/*',
18 | '**/.gitignore',
19 | '**/.idea/**/*',
20 | '**/.travis.yml',
21 | '**/package*',
22 | '**/tsconfig.json',
23 | '**/web-test-runner.config.mjs',
24 | '**/node_modules/**/*',
25 | ],
26 | workspaceRoot: '../../',
27 | mount: {
28 | '../open-scd/': '/open-scd/',
29 | './': '/',
30 | },
31 | alias: {
32 | '@openscd/open-scd': '../open-scd/',
33 | },
34 | };
35 |
--------------------------------------------------------------------------------
/packages/plugins/src/editors/protocol104/base-container.ts:
--------------------------------------------------------------------------------
1 | import { LitElement, property } from 'lit-element';
2 |
3 | export class Base104Container extends LitElement {
4 | @property()
5 | doc!: XMLDocument;
6 | @property({ type: Number })
7 | editCount = -1;
8 | }
9 |
--------------------------------------------------------------------------------
/packages/plugins/src/validators/templates/dabda.ts:
--------------------------------------------------------------------------------
1 | import { get } from 'lit-translate';
2 |
3 | import { identity } from '@openscd/open-scd/src/foundation.js';
4 | import { LogDetailBase } from '@openscd/core/foundation/deprecated/history.js';
5 | import { getTypeChild, isTypeMissing } from './foundation.js';
6 |
7 | export async function dAValidator(element: Element): Promise {
8 | if (isTypeMissing(element))
9 | return [
10 | {
11 | title: get('validator.templates.missingAttribute', {
12 | attr: 'type',
13 | element: element.tagName,
14 | }),
15 | message: `${identity(element)}`,
16 | },
17 | ];
18 |
19 | const child = getTypeChild(element);
20 | if (child === null)
21 | return [
22 | {
23 | title: get('validator.templates.missingReference', {
24 | tag: 'DO',
25 | name: element.getAttribute('name')!,
26 | }),
27 | message: `${identity(element)}`,
28 | },
29 | ];
30 |
31 | return [];
32 | }
33 |
--------------------------------------------------------------------------------
/packages/plugins/src/validators/templates/dosdo.ts:
--------------------------------------------------------------------------------
1 | import { get } from 'lit-translate';
2 | import { identity } from '@openscd/open-scd/src/foundation.js';
3 | import { LogDetailBase } from '@openscd/core/foundation/deprecated/history.js';
4 | import { getTypeChild, isTypeMissing } from './foundation.js';
5 |
6 | export async function dOValidator(element: Element): Promise {
7 | if (isTypeMissing(element))
8 | return [
9 | {
10 | title: get('validator.templates.missingAttribute', {
11 | attr: 'type',
12 | element: element.tagName,
13 | }),
14 | message: `${identity(element)}`,
15 | },
16 | ];
17 |
18 | const child = getTypeChild(element);
19 | if (child === null)
20 | return [
21 | {
22 | title: get('validator.templates.missingReference', {
23 | tag: 'DO',
24 | name: element.getAttribute('name')!,
25 | }),
26 | message: `${identity(element)}`,
27 | },
28 | ];
29 |
30 | return [];
31 | }
32 |
--------------------------------------------------------------------------------
/packages/plugins/test/integration/editors/__snapshots__/Substation.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Substation Plugin without a doc loaded looks like the latest snapshot"] =
5 | `
6 |
7 |
8 |
13 |
14 |
15 | `;
16 | /* end snapshot Substation Plugin without a doc loaded looks like the latest snapshot */
17 |
18 |
--------------------------------------------------------------------------------
/packages/plugins/test/integration/editors/communication/__snapshots__/Communication.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Communication Plugin without a doc loaded looks like the latest snapshot"] =
5 | `
6 |
7 | [communication.missing]
8 |
9 |
14 |
15 |
16 | `;
17 | /* end snapshot Communication Plugin without a doc loaded looks like the latest snapshot */
18 |
19 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/foundation/testFile73.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/foundation/testFile74.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/foundation/testFile81.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/history.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/importieds/emptyproject.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/importieds/invalid.iid:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/importieds/parsererror.iid:
--------------------------------------------------------------------------------
1 | SCL xmlns="http://www.iec.ch/61850/2003/SCL" version="2007" revision="B" release="4"
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/no-history.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/nsdoc/IEC_61850-7-2.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/nsdoc/invalid.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/nsdoc/wrong-version.nsdoc:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/updatedesc/testSignalListComma.csv:
--------------------------------------------------------------------------------
1 |
2 | CB_CLOSED,IED2,IN101
3 | CB_OPEN,IED2,IN102
4 | BB1_DS_CLOSED,IED2,IN103
5 | BB1_DS_OPEN,IED2,IN104
6 | BB2_DS_CLOSED,IED2,IN105
7 | BB2_DS_OPEN,IED2,IN106
8 | LINE_DS_CLOSED,IED2,IN107
9 | LINE_DS_CLOSED,IED2
10 | LINE_DS_CLOSED
11 | LINE_DS_CLOSED,IED2,"IN,107"
12 | ,
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/updatedesc/testSignalListSemicolon.csv:
--------------------------------------------------------------------------------
1 | CB_CLOSED;IED2;IN101
2 | CB_OPEN;IED2;IN102
3 | BB1_DS_CLOSED;IED2;IN103
4 | BB1_DS_OPEN;IED2;IN104
5 | BB2_DS_CLOSED;IED2;IN105
6 | BB2_DS_OPEN;IED2;IN106
7 | LINE_DS_CLOSED;IED2;"IN107"
8 | LINE_DS_CLOSED;"IED2"
9 | LINE_DS_CLOSED
10 | ;
--------------------------------------------------------------------------------
/packages/plugins/test/testfiles/validators/zeroissues.scd:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/GooseSubscriberDataBinding.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import GooseSubscriberDataBinding from '../../../src/editors/GooseSubscriberDataBinding.js';
4 |
5 | describe('SMV Subscribe Data Binding Plugin', () => {
6 | customElements.define(
7 | 'goose-subscriber-data-binding-plugin',
8 | GooseSubscriberDataBinding
9 | );
10 |
11 | let element: GooseSubscriberDataBinding;
12 | let doc: XMLDocument;
13 |
14 | beforeEach(async () => {
15 | doc = await fetch('/test/testfiles/editors/DataBindingGOOSE2007B4.scd')
16 | .then(response => response.text())
17 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
18 |
19 | element = await fixture(
20 | html` `
23 | );
24 | });
25 |
26 | it('looks like the latest snapshot', async () => {
27 | await expect(element).shadowDom.to.equalSnapshot();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/GooseSubscriberLaterBinding.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import GooseSubscriberLaterBinding from '../../../src/editors/GooseSubscriberLaterBinding.js';
4 |
5 | describe('SMV Subscribe Later Binding Plugin', () => {
6 | customElements.define(
7 | 'goose-subscriber-later-binding-plugin',
8 | GooseSubscriberLaterBinding
9 | );
10 |
11 | let element: GooseSubscriberLaterBinding;
12 | let doc: XMLDocument;
13 |
14 | beforeEach(async () => {
15 | doc = await fetch('/test/testfiles/editors/LaterBindingGOOSE2007B4.scd')
16 | .then(response => response.text())
17 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
18 |
19 | element = await fixture(
20 | html` `
23 | );
24 | });
25 |
26 | it('looks like the latest snapshot', async () => {
27 | await expect(element).shadowDom.to.equalSnapshot();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/SMVSubscriberDataBinding.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import SMVSubscribeDataBindingPlugin from '../../../src/editors/SMVSubscriberDataBinding.js';
4 |
5 | describe('SMV Subscribe Data Binding Plugin', () => {
6 | customElements.define(
7 | 'smv-subscribe-data-binding-plugin',
8 | SMVSubscribeDataBindingPlugin
9 | );
10 |
11 | let element: SMVSubscribeDataBindingPlugin;
12 | let doc: XMLDocument;
13 |
14 | beforeEach(async () => {
15 | doc = await fetch('/test/testfiles/editors/DataBindingSMV2007B4.scd')
16 | .then(response => response.text())
17 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
18 |
19 | element = await fixture(
20 | html` `
23 | );
24 | });
25 |
26 | it('looks like the latest snapshot', async () => {
27 | await expect(element).shadowDom.to.equalSnapshot();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/SMVSubscriberLaterBinding.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import SMVSubscribeLaterBindingPlugin from '../../../src/editors/SMVSubscriberLaterBinding.js';
4 |
5 | describe('SMV Subscribe Later Binding Plugin', () => {
6 | customElements.define(
7 | 'smv-subscribe-later-binding-plugin',
8 | SMVSubscribeLaterBindingPlugin
9 | );
10 |
11 | let element: SMVSubscribeLaterBindingPlugin;
12 | let doc: XMLDocument;
13 |
14 | beforeEach(async () => {
15 | doc = await fetch('/test/testfiles/editors/LaterBindingSMV2007B4.scd')
16 | .then(response => response.text())
17 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
18 |
19 | element = await fixture(
20 | html` `
23 | );
24 | });
25 |
26 | it('looks like the latest snapshot', async () => {
27 | await expect(element).shadowDom.to.equalSnapshot();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/__snapshots__/GooseSubscriberDataBinding.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["SMV Subscribe Data Binding Plugin looks like the latest snapshot"] =
5 | `
6 |
7 |
11 |
12 |
16 |
17 |
18 |
19 | `;
20 | /* end snapshot SMV Subscribe Data Binding Plugin looks like the latest snapshot */
21 |
22 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/__snapshots__/GooseSubscriberLaterBinding.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["SMV Subscribe Later Binding Plugin looks like the latest snapshot"] =
5 | `
6 |
7 |
11 |
12 |
16 |
17 |
18 |
19 | `;
20 | /* end snapshot SMV Subscribe Later Binding Plugin looks like the latest snapshot */
21 |
22 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/__snapshots__/SMVSubscriberDataBinding.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["SMV Subscribe Data Binding Plugin looks like the latest snapshot"] =
5 | `
6 |
7 |
11 |
12 |
16 |
17 |
18 |
19 | `;
20 | /* end snapshot SMV Subscribe Data Binding Plugin looks like the latest snapshot */
21 |
22 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/__snapshots__/SMVSubscriberLaterBinding.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["SMV Subscribe Later Binding Plugin looks like the latest snapshot"] =
5 | `
6 |
7 |
11 |
12 |
16 |
17 |
18 |
19 | `;
20 | /* end snapshot SMV Subscribe Later Binding Plugin looks like the latest snapshot */
21 |
22 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/cleanup/foundation.test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from '@open-wc/testing';
2 | import { identitySort } from '../../../../src/editors/cleanup/foundation.js';
3 |
4 | describe('Sorting items by their identity', () => {
5 | let doc: Document;
6 | beforeEach(async () => {
7 | doc = await fetch('/test/testfiles/cleanup.scd')
8 | .then(response => response.text())
9 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
10 | });
11 |
12 | it('returns the correct name for an element.', () => {
13 | const dataSets = doc.querySelectorAll('DataSet');
14 | const orderedDataSets = identitySort(Array.from(dataSets)).map(dataSet =>
15 | dataSet.getAttribute('name')
16 | );
17 | // verified through inspection of the identity of each element
18 | // e.g. const ids = identitySort(Array.from(datasets)).map(ds => identity(ds));
19 | expect(orderedDataSets).to.eql([
20 | 'GooseDataSet1',
21 | 'GooseDataSet2',
22 | 'LogDataSet1',
23 | 'dataSet',
24 | 'dataSet',
25 | 'GooseDataSet1',
26 | 'PhsMeas1',
27 | 'PhsMeas2',
28 | ]);
29 |
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/communication/__snapshots__/conductingap-editor.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["A component to visualize SCL element ConnectedAP looks like the latest snapshot"] =
5 | `
10 |
15 |
16 |
21 |
22 |
23 | `;
24 | /* end snapshot A component to visualize SCL element ConnectedAP looks like the latest snapshot */
25 |
26 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/communication/__snapshots__/gse-editor.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Editor web component for GSE element looks like its latest snapshot"] =
5 | `
9 |
14 |
15 |
20 |
21 |
22 | `;
23 | /* end snapshot Editor web component for GSE element looks like its latest snapshot */
24 |
25 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/communication/__snapshots__/smv-editor.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["Editor web component for SMV element looks like its latest snapshot"] =
5 | `
9 |
14 |
15 |
20 |
21 |
22 | `;
23 | /* end snapshot Editor web component for SMV element looks like its latest snapshot */
24 |
25 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/ied/__snapshots__/element-path.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["element-path looks like the latest snapshot"] =
5 | `
6 | IED1 / AccessPoint1 / My Little Server
7 |
8 | `;
9 | /* end snapshot element-path looks like the latest snapshot */
10 |
11 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/ied/__snapshots__/ied-container.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["ied-container looks like the latest snapshot"] =
5 | `
6 |
7 | developer_board
8 |
9 |
13 |
14 |
15 |
16 |
20 |
21 |
22 |
23 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | `;
34 | /* end snapshot ied-container looks like the latest snapshot */
35 |
36 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/ied/element-path.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import '../../../../src/editors/ied/element-path.js';
4 | import { ElementPath } from '../../../../src/editors/ied/element-path.js';
5 |
6 | describe('element-path', () => {
7 | let element: ElementPath;
8 |
9 | beforeEach(async () => {
10 | element = await fixture(html` `);
13 | });
14 |
15 | it('looks like the latest snapshot', async () => {
16 | await expect(element).shadowDom.to.equalSnapshot();
17 | });
18 | });
19 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/protocol104/__snapshots__/connectedap-container.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["connectedap-104-editor looks like the latest snapshot"] =
5 | `
10 |
15 |
16 |
21 |
22 |
23 | `;
24 | /* end snapshot connectedap-104-editor looks like the latest snapshot */
25 |
26 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/protocol104/__snapshots__/network-container.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["network-104-container looks like the latest snapshot"] =
5 | `
10 |
11 |
17 | `;
18 | /* end snapshot network-104-container looks like the latest snapshot */
19 |
20 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/protocol104/__snapshots__/values-container.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["values-104-container SCL with IED Elements looks like the latest snapshot"] =
5 | `
6 |
7 |
8 |
9 |
10 |
15 |
16 |
17 | `;
18 | /* end snapshot values-104-container SCL with IED Elements looks like the latest snapshot */
19 |
20 | snapshots["values-104-container SCL without IED Elements looks like the latest snapshot"] =
21 | `
22 |
23 | [protocol104.values.missing]
24 |
25 |
26 |
27 |
32 |
33 |
34 | `;
35 | /* end snapshot values-104-container SCL without IED Elements looks like the latest snapshot */
36 |
37 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/protocol104/subnetwork-container.test.ts:
--------------------------------------------------------------------------------
1 | import { html, fixture, expect } from '@open-wc/testing';
2 |
3 | import '../../../../src/editors/protocol104/subnetwork-container.js'
4 | import { SubNetwork104Container } from '../../../../src/editors/protocol104/subnetwork-container.js';
5 |
6 | describe('subnetwork-104-container', () => {
7 | let element: SubNetwork104Container;
8 | let subNetwork: Element;
9 |
10 | beforeEach(async () => {
11 | const validSCL = await fetch('/test/testfiles/104/valid-subnetwork.scd')
12 | .then(response => response.text())
13 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
14 |
15 | subNetwork = validSCL.querySelector('SubNetwork[name="F1"]')!;
16 | element = (
17 | await fixture(
18 | html` `
19 | )
20 | );
21 | });
22 |
23 | it('looks like the latest snapshot', async () => {
24 | await expect(element).shadowDom.to.equalSnapshot();
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/protocol104/wizards/__snapshots__/selectDo.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["data model nodes child getter show DO Picker looks like the latest snapshot"] =
5 | `
11 |
12 |
13 |
14 |
15 |
21 |
22 |
28 |
29 |
30 | `;
31 | /* end snapshot data model nodes child getter show DO Picker looks like the latest snapshot */
32 |
33 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/publisher/foundation.test.ts:
--------------------------------------------------------------------------------
1 | export function cloneTestDoc(doc: XMLDocument): XMLDocument {
2 | const newDoc = document.implementation.createDocument(
3 | doc.lookupNamespaceURI(''),
4 | doc.documentElement.tagName,
5 | doc.doctype
6 | );
7 |
8 | newDoc.documentElement.replaceWith(doc.documentElement);
9 |
10 | return newDoc;
11 | }
12 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/publisher/gse-control-element-editor.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import '../../../../src/editors/publisher/gse-control-element-editor.js';
4 | import { GseControlElementEditor } from '../../../../src/editors/publisher/gse-control-element-editor.js';
5 |
6 | describe('Editor for GSEControl element and its direct children', () => {
7 | let doc: XMLDocument;
8 | let element: GseControlElementEditor;
9 |
10 | beforeEach(async () => {
11 | doc = await fetch('/test/testfiles/wizards/gsecontrol.scd')
12 | .then(response => response.text())
13 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
14 | });
15 |
16 | describe('with valid GSEControl', () => {
17 | beforeEach(async () => {
18 | const gseControl = doc.querySelector('GSEControl')!;
19 |
20 | element = await fixture(
21 | html` `
24 | );
25 | });
26 |
27 | it('looks like the latest snapshot', async () =>
28 | await expect(element).shadowDom.to.equalSnapshot());
29 | });
30 | });
31 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/singlelinediagram/wizards/foundation.test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from '@open-wc/testing';
2 | import {getFixedCoordinateValue} from "../../../../../src/editors/singlelinediagram/wizards/foundation.js";
3 |
4 | describe('Single Line Diagram Wizard foundation', () => {
5 | describe('defines a getFixedCoordinateValue function that', () => {
6 | it("when calling with value null, null will be returned", () => {
7 | expect(getFixedCoordinateValue(null)).to.be.null;
8 | });
9 |
10 | it("when calling with a positive number, number will be returned", () => {
11 | expect(getFixedCoordinateValue("2")).to.be.equal("2");
12 | });
13 |
14 | it("when calling with zero, zero will be returned", () => {
15 | expect(getFixedCoordinateValue("0")).to.be.equal("0");
16 | });
17 |
18 | it("when calling with a negative number, zero will be returned", () => {
19 | expect(getFixedCoordinateValue("-2")).to.be.equal("0");
20 | });
21 |
22 | it("when calling with a invalid number, zero will be returned", () => {
23 | expect(getFixedCoordinateValue("A2")).to.be.equal("0");
24 | });
25 | });
26 | });
27 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/subscription/goose/__snapshots__/subscriber-list.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["subscriber-list-goose initially looks like the latest snapshot"] =
5 | `
6 |
7 | [subscription.goose.publisher.subscriberTitle]
8 |
9 |
10 |
15 |
16 | [subscription.subscriber.noControlBlockSelected]
17 |
18 |
19 |
20 |
21 | `;
22 | /* end snapshot subscriber-list-goose initially looks like the latest snapshot */
23 |
24 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/subscription/goose/subscriber-list.test.ts:
--------------------------------------------------------------------------------
1 | import { html, fixture, expect } from '@open-wc/testing';
2 |
3 | import '../../../../../src/editors/subscription/goose/subscriber-list.js';
4 | import { SubscriberList } from '../../../../../src/editors/subscription/goose/subscriber-list.js';
5 |
6 | describe('subscriber-list-goose', () => {
7 | let element: SubscriberList;
8 | let validSCL: XMLDocument;
9 |
10 | beforeEach(async () => {
11 | validSCL = await fetch('/test/testfiles/valid2007B4.scd')
12 | .then(response => response.text())
13 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
14 |
15 | element = await fixture(html` `);
18 | });
19 |
20 | it('initially looks like the latest snapshot', async () => {
21 | await expect(element).shadowDom.to.equalSnapshot();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/subscription/sampledvalues/__snapshots__/subscriber-list.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["subscriber-list-smv initially looks like the latest snapshot"] =
5 | `
6 |
7 | [subscription.smv.publisher.subscriberTitle]
8 |
9 |
10 |
15 |
16 | [subscription.subscriber.noControlBlockSelected]
17 |
18 |
19 |
20 |
21 | `;
22 | /* end snapshot subscriber-list-smv initially looks like the latest snapshot */
23 |
24 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/editors/subscription/sampledvalues/subscriber-list.test.ts:
--------------------------------------------------------------------------------
1 | import { html, fixture, expect } from '@open-wc/testing';
2 |
3 | import '../../../../../src/editors/subscription/sampledvalues/subscriber-list.js';
4 | import { SubscriberList } from '../../../../../src/editors/subscription/sampledvalues/subscriber-list.js';
5 |
6 | describe('subscriber-list-smv', () => {
7 | let element: SubscriberList;
8 | let validSCL: XMLDocument;
9 |
10 | beforeEach(async () => {
11 | validSCL = await fetch('/test/testfiles/valid2007B4.scd')
12 | .then(response => response.text())
13 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
14 |
15 | element = await fixture(html` `);
18 | });
19 |
20 | it('initially looks like the latest snapshot', async () => {
21 | await expect(element).shadowDom.to.equalSnapshot();
22 | });
23 | });
24 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/validators/templates/foundation.test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from '@open-wc/testing';
2 |
3 | import {
4 | tagValidator,
5 | validateChildren,
6 | } from '../../../../src/validators/templates/foundation.js';
7 |
8 | describe('validator foundation', () => {
9 | describe('tagValidator', () => {
10 | it('tagValidator returns undefined with missing tagName', () => {
11 | expect(tagValidator['noTag']).to.be.undefined;
12 | });
13 | });
14 | describe('validateChildren', () => {
15 | let element: Element;
16 | beforeEach(() => {
17 | element = new DOMParser().parseFromString(
18 | ' ',
19 | 'application/xml'
20 | ).documentElement;
21 | });
22 | it('does not throw Issues for unknown childTags', async () => {
23 | const issues = await validateChildren(element);
24 | expect(issues.length).to.equal(0);
25 | });
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/wizards/__snapshots__/fcda.test.snap.js:
--------------------------------------------------------------------------------
1 | /* @web/test-runner snapshot v1 */
2 | export const snapshots = {};
3 |
4 | snapshots["create wizard for FCDA element with a valid SCL file looks like the last snapshot"] =
5 | `
11 |
12 |
13 |
14 |
15 |
21 |
22 |
28 |
29 |
30 | `;
31 | /* end snapshot create wizard for FCDA element with a valid SCL file looks like the last snapshot */
32 |
33 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/wizards/connectivitynode.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import '@openscd/open-scd/src/addons/Wizards.js';
4 | import { OscdWizards } from '@openscd/open-scd/src/addons/Wizards.js';
5 |
6 | import { editConnectivityNodeWizard } from '../../../src/wizards/connectivitynode.js';
7 |
8 | describe('Wizards for SCL element ConnectivityNode', () => {
9 | let doc: XMLDocument;
10 | let element: OscdWizards;
11 |
12 | beforeEach(async () => {
13 | element = await fixture(
14 | html` `
15 | );
16 | doc = await fetch('/test/testfiles/valid2007B4withSubstationXY.scd')
17 | .then(response => response.text())
18 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
19 |
20 | const wizard = editConnectivityNodeWizard(
21 | doc.querySelector('ConnectivityNode')!
22 | );
23 | element.workflow.push(() => wizard);
24 | await element.requestUpdate();
25 | });
26 | it('looks like the latest snapshot', async () => {
27 | await expect(element.wizardUI.dialog).dom.to.equalSnapshot();
28 | });
29 | });
30 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/wizards/services.test.ts:
--------------------------------------------------------------------------------
1 | import { expect } from '@open-wc/testing';
2 |
3 | import { isEmptyObject } from '../../../src/wizards/services.js';
4 |
5 | describe('Wizards for SCL element Services', () => {
6 | it('Simple empty input object is empty', () => {
7 | const sut = {
8 | foo: '',
9 | };
10 |
11 | expect(isEmptyObject(sut)).to.be.true;
12 | });
13 | it('Complex empty input object is empty', () => {
14 | const sut = {
15 | foo: {
16 | bar: '',
17 | },
18 | };
19 | expect(isEmptyObject(sut)).to.be.true;
20 | });
21 | it('Simple filled input object is not empty', () => {
22 | const sut = {
23 | foo: 'bar',
24 | };
25 | expect(isEmptyObject(sut)).to.be.false;
26 | });
27 | it('Complex filled input object is not empty', () => {
28 | const sut = {
29 | foo: {
30 | bar: 'qux',
31 | },
32 | };
33 | expect(isEmptyObject(sut)).to.be.false;
34 | });
35 | });
36 |
--------------------------------------------------------------------------------
/packages/plugins/test/unit/wizards/terminal.test.ts:
--------------------------------------------------------------------------------
1 | import { expect, fixture, html } from '@open-wc/testing';
2 |
3 | import '@openscd/open-scd/src/addons/Wizards.js';
4 | import { OscdWizards } from '@openscd/open-scd/src/addons/Wizards.js';
5 |
6 | import { editTerminalWizard } from '../../../src/wizards/terminal.js';
7 |
8 | describe('Wizards for SCL element Terminal', () => {
9 | let doc: XMLDocument;
10 | let element: OscdWizards;
11 |
12 | beforeEach(async () => {
13 | element = await fixture(
14 | html` `
15 | );
16 | doc = await fetch('/test/testfiles/valid2007B4withSubstationXY.scd')
17 | .then(response => response.text())
18 | .then(str => new DOMParser().parseFromString(str, 'application/xml'));
19 |
20 | const wizard = editTerminalWizard(doc.querySelector('Terminal')!);
21 | element.workflow.push(() => wizard);
22 | await element.requestUpdate();
23 | });
24 | it('looks like the latest snapshot', async () => {
25 | await expect(element.wizardUI.dialog).dom.to.equalSnapshot();
26 | });
27 | });
28 |
--------------------------------------------------------------------------------
/packages/plugins/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2020",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "noEmitOnError": true,
7 | "lib": ["es2020", "dom"],
8 | "strict": true,
9 | "esModuleInterop": false,
10 | "allowSyntheticDefaultImports": true,
11 | "experimentalDecorators": true,
12 | "importHelpers": true,
13 | "allowJs": true,
14 | "skipLibCheck": true,
15 | "outDir": "dist",
16 | "sourceMap": true,
17 | "inlineSources": true,
18 | "resolveJsonModule": true,
19 | "rootDir": "./src"
20 | },
21 | "include": ["src/**/*.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/packages/plugins/workbox-config.cjs:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | globDirectory: 'build/',
3 | globPatterns: [
4 | 'public/**/*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}',
5 | 'src/**/*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}',
6 | '*.{md,js,png,xml,pdf,css,html,info,json,ico,svg,wasm}',
7 | ],
8 | swDest: 'build/sw.js',
9 | runtimeCaching: [
10 | {
11 | urlPattern: /.*/,
12 | handler: 'NetworkFirst',
13 | },
14 | ],
15 | skipWaiting: true,
16 | inlineWorkboxRuntime: true,
17 | };
18 |
--------------------------------------------------------------------------------
/packages/wizards/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@openscd/wizards",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/wizards/src",
6 | "targets": {}
7 | }
8 |
--------------------------------------------------------------------------------
/packages/xml/.gitignore:
--------------------------------------------------------------------------------
1 | .tsbuildinfo
2 |
3 | dist/
4 | node_modules/
5 | doc/
6 | coverage/
7 |
--------------------------------------------------------------------------------
/packages/xml/.npmignore:
--------------------------------------------------------------------------------
1 | ## editors
2 | /.idea
3 | /.vscode
4 |
5 | ## system files
6 | .DS_Store
7 |
8 | ## npm
9 | /node_modules/
10 | /npm-debug.log
11 |
12 | ## testing
13 | /coverage/
14 |
15 | ## local debug
16 | /.npmrc
17 |
18 | ## temp folders
19 | /.tmp/
20 |
21 | # build
22 | /_site/
23 | /out-tsc/
24 |
25 | storybook-static
26 | custom-elements.json
27 |
--------------------------------------------------------------------------------
/packages/xml/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
--------------------------------------------------------------------------------
/packages/xml/README.md:
--------------------------------------------------------------------------------
1 | # OpenSCD XML
2 |
--------------------------------------------------------------------------------
/packages/xml/project.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@openscd/xml",
3 | "$schema": "../../node_modules/nx/schemas/project-schema.json",
4 | "projectType": "library",
5 | "sourceRoot": "packages/xml/src",
6 | "targets": {}
7 | }
8 |
--------------------------------------------------------------------------------
/packages/xml/src/index.ts:
--------------------------------------------------------------------------------
1 | export { createElement, cloneElement, getUniqueElementName, getChildElementsByTagName, formatXml } from './foundation.js';
2 |
--------------------------------------------------------------------------------
/packages/xml/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es2018",
4 | "module": "esnext",
5 | "moduleResolution": "node",
6 | "noEmitOnError": true,
7 | "lib": ["es2018", "dom"],
8 | "strict": true,
9 | "esModuleInterop": false,
10 | "allowSyntheticDefaultImports": true,
11 | "experimentalDecorators": true,
12 | "declaration": true,
13 | "importHelpers": true,
14 | "outDir": "./dist",
15 | "sourceMap": true,
16 | "inlineSources": true,
17 | "rootDir": "./src",
18 | "tsBuildInfoFile": ".tsbuildinfo",
19 | "incremental": true,
20 | "skipLibCheck": true
21 | },
22 | "include": ["src/**/*.ts"]
23 | }
24 |
--------------------------------------------------------------------------------
/packages/xml/tsconfig.test.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "rootDir": "./"
5 | },
6 | "files": [
7 | "./**/*.ts"
8 | ]
9 | }
--------------------------------------------------------------------------------
/packages/xml/web-test-runner.config.mjs:
--------------------------------------------------------------------------------
1 | // import { playwrightLauncher } from '@web/test-runner-playwright';
2 | import { esbuildPlugin } from '@web/dev-server-esbuild';
3 |
4 | export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
5 | /** we run test directly on TypeScript files */
6 | plugins: [esbuildPlugin({ ts: true })],
7 |
8 | /** Resolve bare module imports */
9 | nodeResolve: true,
10 |
11 | /** filter browser logs
12 | * Plugins have a fix URL and do not fit to the file structure in test environment.
13 | * Creating open-scd in the tests leads to error in the browser log - we had to disable the browser log
14 | */
15 | browserLogs: false,
16 |
17 | /** specify groups for unit and integrations tests
18 | * hint: no --group definition runs all groups
19 | */
20 | groups: [
21 | {
22 | name: 'unit',
23 | files: 'test/**/*.test.ts',
24 | },
25 | ],
26 | });
27 |
--------------------------------------------------------------------------------