Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion custom-elements.json
Original file line number Diff line number Diff line change
Expand Up @@ -1535,7 +1535,7 @@
},
{
"kind": "js",
"name": "OscdEditorDiff",
"name": "default",
"declaration": {
"name": "OscdEditorDiff",
"module": "oscd-editor-diff.ts"
Expand Down
11 changes: 4 additions & 7 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<title>oscd-designer demo</title>
<title>oscd-editor-diff demo</title>
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Roboto+Mono:wght@300&family=Roboto:wght@300;400;500&display=swap"
Expand All @@ -10,6 +10,7 @@
<oscd-shell></oscd-shell>

<script type="module">
import '@webcomponents/scoped-custom-element-registry';
import '@omicronenergy/oscd-shell/oscd-shell.js';
import { plugins } from './plugins.js';

Expand All @@ -24,12 +25,8 @@
const sample = await fetch('sample.scd').then(r => r.text());
const sample2 = await fetch('sample2.scd').then(r => r.text());
editor.docs = {
['sample.scd']: new DOMParser().parseFromString(sample, 'application/xml'),

['sample2.scd']: new DOMParser().parseFromString(
sample2,
'application/xml',
),
'sample.scd': new DOMParser().parseFromString(sample, 'application/xml'),
'sample2.scd': new DOMParser().parseFromString(sample2, 'application/xml'),
};
editor.docName = 'sample.scd';
</script>
Expand Down
14 changes: 8 additions & 6 deletions demo/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import OscdMenuOpen from '@omicronenergy/oscd-menu-open';
import OscdMenuSave from '@omicronenergy/oscd-menu-save';
import OscdBackgroundEditV1 from '@omicronenergy/oscd-background-editv1';

import { OscdEditorDiff } from '../oscd-editor-diff.js';
import OscdEditorDiff from '../dist/oscd-editor-diff.js';

customElements.define('oscd-menu-open', OscdMenuOpen);
customElements.define('oscd-menu-save', OscdMenuSave);
customElements.define('oscd-background-editv1', OscdBackgroundEditV1);
customElements.define('oscd-editor-diff', OscdEditorDiff);
const { registry } = document.querySelector('oscd-shell');

registry.define('oscd-menu-open', OscdMenuOpen);
registry.define('oscd-menu-save', OscdMenuSave);
registry.define('oscd-background-editv1', OscdBackgroundEditV1);
registry.define('oscd-editor-diff', OscdEditorDiff);

export const plugins = {
menu: [
Expand All @@ -28,8 +30,8 @@ export const plugins = {
editor: [
{
name: 'Diff',
translations: { de: 'Vergleichen' },
icon: 'difference',
active: true,
requireDoc: true,
tagName: 'oscd-editor-diff',
},
Expand Down
4 changes: 2 additions & 2 deletions oscd-editor-diff.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { LitElement, html, css, nothing } from 'lit';
import { property, query, state } from 'lit/decorators.js';

import { identity } from '@openenergytools/scl-lib';
import { identity } from '@openscd/scl-lib';

import '@material/web/all.js';
import type { MdDialog, MdFilledSelect, MdMenu } from '@material/web/all.js';
Expand Down Expand Up @@ -189,7 +189,7 @@ function describeConfigurable(
return html`${verb}${object}${exceptions}`;
}

export class OscdEditorDiff extends LitElement {
export default class OscdEditorDiff extends LitElement {
@property() docName = '';

@property() doc?: XMLDocument;
Expand Down
Loading