@compas-oscd/open-scd 0.35.1 → 0.35.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,6 +43,7 @@ export declare class OscdHistory extends LitElement {
43
43
  host: HTMLElement;
44
44
  latestIssue: IssueDetail;
45
45
  history: HistoryItem[];
46
+ validationTimes: Map<string, Date>;
46
47
  get canRedo(): boolean;
47
48
  get canUndo(): boolean;
48
49
  logUI: Dialog;
@@ -69,6 +70,7 @@ export declare class OscdHistory extends LitElement {
69
70
  renderLogEntry(entry: InfoEntry, index: number, log: LogEntry[]): TemplateResult;
70
71
  renderHistoryEntry(entry: HistoryItem): TemplateResult;
71
72
  private formatTime;
73
+ private formatValidationTime;
72
74
  private renderLog;
73
75
  private renderHistory;
74
76
  protected renderIssueEntry(issue: IssueDetail): TemplateResult;
@@ -72,6 +72,7 @@ let OscdHistory = class OscdHistory extends LitElement {
72
72
  this.diagnoses.set(de.detail.validatorId, [de.detail]);
73
73
  else
74
74
  issues?.push(de.detail);
75
+ this.validationTimes.set(de.detail.validatorId, new Date());
75
76
  this.latestIssue = de.detail;
76
77
  this.issueUI.close();
77
78
  this.issueUI.show();
@@ -171,6 +172,7 @@ let OscdHistory = class OscdHistory extends LitElement {
171
172
  this.log = [];
172
173
  this.diagnoses = new Map();
173
174
  this.history = [];
175
+ this.validationTimes = new Map();
174
176
  this.unsubscribers = [];
175
177
  this.undo = this.undo.bind(this);
176
178
  this.redo = this.redo.bind(this);
@@ -199,12 +201,12 @@ let OscdHistory = class OscdHistory extends LitElement {
199
201
  graphic="icon"
200
202
  ?twoline=${!!entry.message}
201
203
  >
202
- <span>
204
+ <span class="selectable-text">
203
205
  <!-- FIXME: replace tt with mwc-chip asap -->
204
206
  <tt>${entry.time?.toLocaleString()}</tt>
205
207
  ${entry.title}</span
206
208
  >
207
- <span slot="secondary">${entry.message}</span>
209
+ <span class="selectable-text" slot="secondary">${entry.message}</span>
208
210
  <mwc-icon
209
211
  slot="graphic"
210
212
  style="--mdc-theme-text-icon-on-background:var(${iconColors[entry.kind]})"
@@ -233,6 +235,12 @@ let OscdHistory = class OscdHistory extends LitElement {
233
235
  const minutes = date.getMinutes();
234
236
  return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`;
235
237
  }
238
+ formatValidationTime(time) {
239
+ const date = new Date(time);
240
+ const dateStr = date.toLocaleDateString();
241
+ const timeStr = date.toLocaleTimeString();
242
+ return `${dateStr} ${timeStr}`;
243
+ }
236
244
  renderLog() {
237
245
  if (this.log.length > 0)
238
246
  return this.log.slice().reverse().map(this.renderLogEntry, this);
@@ -253,19 +261,28 @@ let OscdHistory = class OscdHistory extends LitElement {
253
261
  }
254
262
  renderIssueEntry(issue) {
255
263
  return html ` <abbr title="${issue.title + '\n' + issue.message}"
256
- ><mwc-list-item ?twoline=${!!issue.message}>
257
- <span> ${issue.title}</span>
258
- <span slot="secondary">${issue.message}</span>
264
+ ><mwc-list-item noninteractive ?twoline=${!!issue.message}>
265
+ <span class="selectable-text"> ${issue.title}</span>
266
+ <span class="selectable-text" slot="secondary">${issue.message}</span>
259
267
  </mwc-list-item></abbr
260
268
  >`;
261
269
  }
262
270
  renderValidatorsIssues(issues) {
263
271
  if (issues.length === 0)
264
272
  return [html ``];
273
+ const lastValidated = this.validationTimes.get(issues[0].validatorId);
265
274
  return [
266
275
  html `
267
- <mwc-list-item noninteractive>
268
- ${getPluginName(issues[0].validatorId)}
276
+ <mwc-list-item noninteractive ?twoline=${!!lastValidated}>
277
+ <span>${getPluginName(issues[0].validatorId)}</span>
278
+ ${lastValidated
279
+ ? html `<span slot="secondary" class="validation-time"
280
+ >${get('diag.lastValidated', {
281
+ time: this.formatValidationTime(lastValidated.getTime()),
282
+ })}</span
283
+ >`
284
+ : ''}
285
+ </span>
269
286
  </mwc-list-item>
270
287
  `,
271
288
  html `<li divider padded role="separator"></li>`,
@@ -324,6 +341,18 @@ let OscdHistory = class OscdHistory extends LitElement {
324
341
  render() {
325
342
  return html `<slot></slot>
326
343
  <style>
344
+ .selectable-text {
345
+ user-select: text;
346
+ -webkit-user-select: text;
347
+ cursor: text;
348
+ }
349
+
350
+ .validation-time {
351
+ color: var(--base1);
352
+ font-size: 0.85em;
353
+ white-space: nowrap;
354
+ }
355
+
327
356
  #log > mwc-icon-button-toggle {
328
357
  position: absolute;
329
358
  top: 8px;
@@ -469,6 +498,9 @@ __decorate([
469
498
  __decorate([
470
499
  state()
471
500
  ], OscdHistory.prototype, "history", void 0);
501
+ __decorate([
502
+ state()
503
+ ], OscdHistory.prototype, "validationTimes", void 0);
472
504
  __decorate([
473
505
  query('#log')
474
506
  ], OscdHistory.prototype, "logUI", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"History.js","sourceRoot":"","sources":["../../src/addons/History.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EAEL,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,sBAAsB,CAAC;AAC9B,OAAO,oBAAoB,CAAC;AAC5B,OAAO,2BAA2B,CAAC;AACnC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oBAAoB,CAAC;AAC5B,OAAO,kCAAkC,CAAC;AAC1C,OAAO,wBAAwB,CAAC;AAIhC,OAAO,qBAAqB,CAAC;AAY7B,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAK9D,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AASvD,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,KAAK,EAAE,QAAQ;CAChB,CAAC;AAEF,SAAS,aAAa,CAAC,GAAW;IAEhC,IAAI,mBAAmB,GAAG,YAAY,CAAC,OAAO,CAAC,SAAS,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mBAKpB,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;aAC7B,GAAG,CAAC,mBAAmB,CAAC;;;;;;;qBAOhB,IAAI,CAAC,WAAW,EAAE,KAAK;YACpC,GAAG,CAAC,0BAA0B,CAAC;;;;;mBAKpB,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;aACpC,GAAG,CAAC,mBAAmB,CAAC;;;sBAGf,CAAC;IACrB,CAAC;CACF,CAAA;AA1cC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wCACJ;AAGM;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAoB;AAG/C;IADC,QAAQ,EAAE;8CACkC;AAG7C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACR;AAGnB;IADC,KAAK,EAAE;gDACkB;AAG1B;IADC,KAAK,EAAE;4CACoB;AAUb;IAAd,KAAK,CAAC,MAAM,CAAC;0CAAgB;AACX;IAAlB,KAAK,CAAC,UAAU,CAAC;8CAAoB;AAChB;IAArB,KAAK,CAAC,aAAa,CAAC;iDAAuB;AAC3B;IAAhB,KAAK,CAAC,QAAQ,CAAC;4CAAoB;AACjB;IAAlB,KAAK,CAAC,UAAU,CAAC;8CAAsB;AACxB;IAAf,KAAK,CAAC,OAAO,CAAC;2CAAmB;AACjB;IAAhB,KAAK,CAAC,QAAQ,CAAC;4CAAoB;AAlCzB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA6cvB;SA7cY,WAAW","sourcesContent":["import {\n html,\n state,\n property,\n query,\n TemplateResult,\n customElement,\n LitElement,\n} from 'lit-element';\n\nimport { get } from 'lit-translate';\n\nimport '@material/mwc-button';\nimport '@material/mwc-dialog';\nimport '@material/mwc-icon';\nimport '@material/mwc-icon-button';\nimport '@material/mwc-icon-button-toggle';\nimport '@material/mwc-list';\nimport '@material/mwc-list/mwc-list-item';\nimport '@material/mwc-snackbar';\nimport { Dialog } from '@material/mwc-dialog';\nimport { Snackbar } from '@material/mwc-snackbar';\n\nimport '../filtered-list.js';\n\nimport {\n InfoDetail,\n InfoEntry,\n IssueDetail,\n IssueEvent,\n LogEntry,\n LogEntryType,\n LogEvent,\n} from '@compas-oscd/core';\n\nimport { getFilterIcon, iconColors } from '../icons/icons.js';\n\nimport { Plugin } from '../plugin.js';\nimport { XMLEditor } from '@openscd/oscd-editor';\n\nimport { getLogText } from './history/get-log-text.js';\n\ninterface HistoryItem {\n title: string;\n message?: string;\n time: number;\n isActive: boolean;\n}\n\nconst icons = {\n info: 'info',\n warning: 'warning',\n error: 'report',\n};\n\nfunction getPluginName(src: string): string {\n\n let storedPluginsString = localStorage.getItem('plugins');\n if(!storedPluginsString) {\n storedPluginsString = '[]';\n }\n\n const storedPlugins = JSON.parse(storedPluginsString) as Plugin[];\n const wantedPlugin = storedPlugins.find((p: Plugin) => p.src === src);\n\n if(!wantedPlugin) {\n return `pluginnotfound: ${src} in ${storedPluginsString}`;\n }\n\n const name = wantedPlugin.name;\n\n if(!name){\n return `pluginhasnoname:${src}`;\n }\n\n return name;\n\n}\n\nexport enum HistoryUIKind {\n log = 'log',\n history = 'history',\n diagnostic = 'diagnostic',\n}\nexport interface HistoryUIDetail {\n show: boolean;\n kind: HistoryUIKind;\n}\n\nexport type HistoryUIEvent = CustomEvent<HistoryUIDetail>;\n\nexport function newHistoryUIEvent(\n show: boolean,\n kind: HistoryUIKind,\n eventInitDict?: CustomEventInit<Partial<HistoryUIDetail>>\n): HistoryUIEvent {\n return new CustomEvent<HistoryUIDetail>('history-dialog-ui', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: {\n show,\n kind,\n ...eventInitDict?.detail,\n },\n });\n}\n\nexport interface EmptyIssuesDetail {\n pluginSrc: string;\n}\n\nexport type EmptyIssuesEvent = CustomEvent<EmptyIssuesDetail>;\n\nexport function newEmptyIssuesEvent(\n pluginSrc: string,\n eventInitDict?: CustomEventInit<Partial<EmptyIssuesDetail>>\n): EmptyIssuesEvent {\n return new CustomEvent<EmptyIssuesDetail>('empty-issues', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: { pluginSrc, ...eventInitDict?.detail },\n });\n}\n\n@customElement('oscd-history')\nexport class OscdHistory extends LitElement {\n /** All [[`LogEntry`]]s received so far through [[`LogEvent`]]s. */\n @property({ type: Array })\n log: InfoEntry[] = [];\n\n /** XML Editor to apply changes to the scd */\n @property({ type: Object }) editor!: XMLEditor;\n\n @property()\n diagnoses = new Map<string, IssueDetail[]>();\n\n @property({ type: Object })\n host!: HTMLElement;\n\n @state()\n latestIssue!: IssueDetail;\n\n @state()\n history: HistoryItem[] = [];\n\n get canRedo(): boolean {\n return this.editor.future.length >= 1;\n }\n\n get canUndo(): boolean {\n return this.editor.past.length >= 1;\n }\n\n @query('#log') logUI!: Dialog;\n @query('#history') historyUI!: Dialog;\n @query('#diagnostic') diagnosticUI!: Dialog;\n @query('#error') errorUI!: Snackbar;\n @query('#warning') warningUI!: Snackbar;\n @query('#info') infoUI!: Snackbar;\n @query('#issue') issueUI!: Snackbar;\n\n private unsubscribers: (() => any)[] = [];\n\n private onIssue(de: IssueEvent): void {\n const issues = this.diagnoses.get(de.detail.validatorId);\n\n if (!issues) this.diagnoses.set(de.detail.validatorId, [de.detail]);\n else issues?.push(de.detail);\n\n this.latestIssue = de.detail;\n this.issueUI.close();\n this.issueUI.show();\n }\n\n undo(): void {\n this.editor.undo();\n }\n redo(): void {\n this.editor.redo();\n }\n\n private onReset() {\n this.log = [];\n this.diagnoses.clear();\n this.editor.past = [];\n this.editor.future = [];\n this.updateHistory();\n }\n\n private onInfo(detail: InfoDetail) {\n const entry: InfoEntry = {\n time: new Date(),\n ...detail,\n };\n\n this.log.push(entry);\n if (!this.logUI.open) {\n const ui = {\n error: this.errorUI,\n warning: this.warningUI,\n info: this.infoUI,\n }[detail.kind];\n\n ui.close();\n ui.show();\n }\n if (detail.kind == 'error') {\n this.errorUI.close(); // hack to reset timeout\n this.errorUI.show();\n }\n this.requestUpdate('log', []);\n }\n\n private onLog(le: LogEvent): void {\n switch (le.detail.kind) {\n case 'reset':\n this.onReset();\n break;\n case 'action':\n // No longer needed\n break;\n default:\n this.onInfo(le.detail);\n break;\n }\n }\n\n private historyUIHandler(e: HistoryUIEvent): void {\n const ui = {\n log: this.logUI,\n history: this.historyUI,\n diagnostic: this.diagnosticUI,\n }[e.detail.kind];\n\n if (e.detail.show) ui.show();\n else ui.close();\n }\n\n private emptyIssuesHandler(e: EmptyIssuesEvent): void {\n if (this.diagnoses.get(e.detail.pluginSrc))\n this.diagnoses.get(e.detail.pluginSrc)!.length = 0;\n }\n\n private handleKeyPress(e: KeyboardEvent): void {\n const ctrlAnd = (key: string) => e.key === key && e.ctrlKey;\n\n if (ctrlAnd('y')) this.redo();\n if (ctrlAnd('z')) this.undo();\n if (ctrlAnd('l')) this.logUI.open ? this.logUI.close() : this.logUI.show();\n if (ctrlAnd('d'))\n this.diagnosticUI.open\n ? this.diagnosticUI.close()\n : this.diagnosticUI.show();\n }\n\n private updateHistory(): void {\n const { past, future } = this.editor;\n\n const activeIndex = past.length - 1;\n const allEntries = [ ...past, ...future ];\n\n this.history = allEntries.map((e, index) => {\n const { title, message } = getLogText(e.redo as any);\n\n return {\n isActive: index === activeIndex,\n time: e.time,\n title: e.title ?? title,\n message\n };\n });\n }\n\n constructor() {\n super();\n this.undo = this.undo.bind(this);\n this.redo = this.redo.bind(this);\n this.onLog = this.onLog.bind(this);\n this.onIssue = this.onIssue.bind(this);\n this.historyUIHandler = this.historyUIHandler.bind(this);\n this.emptyIssuesHandler = this.emptyIssuesHandler.bind(this);\n this.handleKeyPress = this.handleKeyPress.bind(this);\n document.onkeydown = this.handleKeyPress;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.unsubscribers.push(\n this.editor.subscribe(() =>\n this.updateHistory()\n )\n );\n\n this.host.addEventListener('log', this.onLog);\n this.host.addEventListener('issue', this.onIssue);\n this.host.addEventListener('history-dialog-ui', this.historyUIHandler);\n this.host.addEventListener('empty-issues', this.emptyIssuesHandler);\n }\n\n disconnectedCallback(): void {\n this.unsubscribers.forEach(u => u());\n }\n\n renderLogEntry(\n entry: InfoEntry,\n index: number,\n log: LogEntry[]\n ): TemplateResult {\n return html` <abbr title=\"${entry.title}\">\n <mwc-list-item\n class=\"${entry.kind}\"\n graphic=\"icon\"\n ?twoline=${!!entry.message}\n >\n <span>\n <!-- FIXME: replace tt with mwc-chip asap -->\n <tt>${entry.time?.toLocaleString()}</tt>\n ${entry.title}</span\n >\n <span slot=\"secondary\">${entry.message}</span>\n <mwc-icon\n slot=\"graphic\"\n style=\"--mdc-theme-text-icon-on-background:var(${iconColors[\n entry.kind\n ]})\"\n >${icons[entry.kind]}</mwc-icon\n >\n </mwc-list-item></abbr\n >`;\n }\n\n renderHistoryEntry(\n entry: HistoryItem\n ): TemplateResult {\n return html` <abbr title=\"${entry.title}\">\n <mwc-list-item\n ?twoline=${!!entry.message}\n ?activated=${entry.isActive}\n >\n <span>\n <tt>${this.formatTime(entry.time)}</tt>\n ${entry.title}\n </span>\n <span slot=\"secondary\">${entry.message}</span>\n </mwc-list-item>\n </abbr>`;\n }\n\n private formatTime(time: number): string {\n const date = new Date(time);\n const hours = date.getHours();\n const minutes = date.getMinutes();\n return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`\n }\n\n private renderLog(): TemplateResult[] | TemplateResult {\n if (this.log.length > 0)\n return this.log.slice().reverse().map(this.renderLogEntry, this);\n else\n return html`<mwc-list-item disabled graphic=\"icon\">\n <span>${get('log.placeholder')}</span>\n <mwc-icon slot=\"graphic\">info</mwc-icon>\n </mwc-list-item>`;\n }\n\n private renderHistory(): TemplateResult[] | TemplateResult {\n if (this.history.length > 0)\n return this.history.slice().reverse().map(e => this.renderHistoryEntry(e));\n else\n return html`<mwc-list-item disabled graphic=\"icon\">\n <span>${get('history.placeholder')}</span>\n <mwc-icon slot=\"graphic\">info</mwc-icon>\n </mwc-list-item>`;\n }\n\n protected renderIssueEntry(issue: IssueDetail): TemplateResult {\n return html` <abbr title=\"${issue.title + '\\n' + issue.message}\"\n ><mwc-list-item ?twoline=${!!issue.message}>\n <span> ${issue.title}</span>\n <span slot=\"secondary\">${issue.message}</span>\n </mwc-list-item></abbr\n >`;\n }\n\n renderValidatorsIssues(issues: IssueDetail[]): TemplateResult[] {\n if (issues.length === 0) return [html``];\n return [\n html`\n <mwc-list-item noninteractive>\n ${getPluginName(issues[0].validatorId)}\n </mwc-list-item>\n `,\n html`<li divider padded role=\"separator\"></li>`,\n ...issues.map(issue => this.renderIssueEntry(issue)),\n ];\n }\n\n private renderIssues(): TemplateResult[] | TemplateResult {\n const issueItems: TemplateResult[] = [];\n\n this.diagnoses.forEach(issues => {\n this.renderValidatorsIssues(issues).forEach(issueItem =>\n issueItems.push(issueItem)\n );\n });\n\n return issueItems.length\n ? issueItems\n : html`<mwc-list-item disabled graphic=\"icon\">\n <span>${get('diag.placeholder')}</span>\n <mwc-icon slot=\"graphic\">info</mwc-icon>\n </mwc-list-item>`;\n }\n\n private renderFilterButtons() {\n return (<LogEntryType[]>Object.keys(icons)).map(\n kind => html`<mwc-icon-button-toggle id=\"${kind}filter\" on\n >${getFilterIcon(kind, false)}\n ${getFilterIcon(kind, true)}</mwc-icon-button-toggle\n >`\n );\n }\n\n private renderLogDialog(): TemplateResult {\n return html` <mwc-dialog id=\"log\" heading=\"${get('log.name')}\">\n ${this.renderFilterButtons()}\n <mwc-list id=\"content\" wrapFocus>${this.renderLog()}</mwc-list>\n <mwc-button slot=\"primaryAction\" dialogaction=\"close\"\n >${get('close')}</mwc-button\n >\n </mwc-dialog>`;\n }\n\n private renderHistoryUI(): TemplateResult {\n return html` <mwc-dialog id=\"history\" heading=\"${get('history.name')}\">\n <mwc-list id=\"content\" wrapFocus>${this.renderHistory()}</mwc-list>\n <mwc-button\n icon=\"undo\"\n label=\"${get('undo')}\"\n ?disabled=${!this.canUndo}\n @click=${this.undo}\n slot=\"secondaryAction\"\n ></mwc-button>\n <mwc-button\n icon=\"redo\"\n label=\"${get('redo')}\"\n ?disabled=${!this.canRedo}\n @click=${this.redo}\n slot=\"secondaryAction\"\n ></mwc-button>\n <mwc-button slot=\"primaryAction\" dialogaction=\"close\"\n >${get('close')}</mwc-button\n >\n </mwc-dialog>`;\n }\n\n render(): TemplateResult {\n return html`<slot></slot>\n <style>\n #log > mwc-icon-button-toggle {\n position: absolute;\n top: 8px;\n right: 14px;\n }\n #log > mwc-icon-button-toggle:nth-child(2) {\n right: 62px;\n }\n #log > mwc-icon-button-toggle:nth-child(3) {\n right: 110px;\n }\n #log > mwc-icon-button-toggle:nth-child(4) {\n right: 158px;\n }\n #content mwc-list-item.info,\n #content mwc-list-item.warning,\n #content mwc-list-item.error {\n display: none;\n }\n #infofilter[on] ~ #content mwc-list-item.info {\n display: flex;\n }\n #warningfilter[on] ~ #content mwc-list-item.warning {\n display: flex;\n }\n #errorfilter[on] ~ #content mwc-list-item.error {\n display: flex;\n }\n\n #infofilter[on] {\n color: var(--cyan);\n }\n\n #warningfilter[on] {\n color: var(--yellow);\n }\n\n #errorfilter[on] {\n color: var(--red);\n }\n\n #actionfilter[on] {\n color: var(--blue);\n }\n\n #log,\n #history {\n --mdc-dialog-min-width: 92vw;\n }\n\n #log > #filterContainer {\n position: absolute;\n top: 14px;\n right: 14px;\n }\n </style>\n ${this.renderLogDialog()} ${this.renderHistoryUI()}\n <mwc-dialog id=\"diagnostic\" heading=\"${get('diag.name')}\">\n <filtered-list id=\"content\" wrapFocus>\n ${this.renderIssues()}\n </filtered-list>\n <mwc-button slot=\"primaryAction\" dialogaction=\"close\">\n ${get('close')}\n </mwc-button>\n </mwc-dialog>\n\n <mwc-snackbar\n id=\"info\"\n timeoutMs=\"4000\"\n labelText=\"${this.log\n .slice()\n .reverse()\n .find(le => le.kind === 'info')?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>\n <mwc-snackbar\n id=\"warning\"\n timeoutMs=\"6000\"\n labelText=\"${this.log\n .slice()\n .reverse()\n .find(le => le.kind === 'warning')?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-button\n slot=\"action\"\n icon=\"history\"\n @click=${() => this.logUI.show()}\n >${get('log.snackbar.show')}</mwc-button\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>\n <mwc-snackbar\n id=\"error\"\n timeoutMs=\"10000\"\n labelText=\"${this.log\n .slice()\n .reverse()\n .find(le => le.kind === 'error')?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-button\n slot=\"action\"\n icon=\"history\"\n @click=${() => this.logUI.show()}\n >${get('log.snackbar.show')}</mwc-button\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>\n <mwc-snackbar\n id=\"issue\"\n timeoutMs=\"10000\"\n labelText=\"${this.latestIssue?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-button\n slot=\"action\"\n icon=\"rule\"\n @click=${() => this.diagnosticUI.show()}\n >${get('log.snackbar.show')}</mwc-button\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>`;\n }\n}\n\ndeclare global {\n interface ElementEventMap {\n 'history-dialog-ui': CustomEvent<HistoryUIDetail>;\n 'empty-issues': CustomEvent<EmptyIssuesDetail>;\n }\n}\n"]}
1
+ {"version":3,"file":"History.js","sourceRoot":"","sources":["../../src/addons/History.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,IAAI,EACJ,KAAK,EACL,QAAQ,EACR,KAAK,EAEL,aAAa,EACb,UAAU,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAEpC,OAAO,sBAAsB,CAAC;AAC9B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AK,OAAO,CAAC,EAAE,KAAK;YACzC,GAAG,CAAC,0BAA0B,CAAC;;;;;mBAKpB,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;aAC7B,GAAG,CAAC,mBAAmB,CAAC;;;;;;;qBAOhB,IAAI,CAAC,WAAW,EAAE,KAAK;YACpC,GAAG,CAAC,0BAA0B,CAAC;;;;;mBAKpB,GAAG,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE;aACpC,GAAG,CAAC,mBAAmB,CAAC;;;sBAGf,CAAC;IACrB,CAAC;CACF,CAAA;AA7eC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;wCACJ;AAGM;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAoB;AAG/C;IADC,QAAQ,EAAE;8CACkC;AAG7C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACR;AAGnB;IADC,KAAK,EAAE;gDACkB;AAG1B;IADC,KAAK,EAAE;4CACoB;AAG5B;IADC,KAAK,EAAE;oDACkC;AAU3B;IAAd,KAAK,CAAC,MAAM,CAAC;0CAAgB;AACX;IAAlB,KAAK,CAAC,UAAU,CAAC;8CAAoB;AAChB;IAArB,KAAK,CAAC,aAAa,CAAC;iDAAuB;AAC3B;IAAhB,KAAK,CAAC,QAAQ,CAAC;4CAAoB;AACjB;IAAlB,KAAK,CAAC,UAAU,CAAC;8CAAsB;AACxB;IAAf,KAAK,CAAC,OAAO,CAAC;2CAAmB;AACjB;IAAhB,KAAK,CAAC,QAAQ,CAAC;4CAAoB;AArCzB,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CAgfvB;SAhfY,WAAW","sourcesContent":["import {\n html,\n state,\n property,\n query,\n TemplateResult,\n customElement,\n LitElement,\n} from 'lit-element';\n\nimport { get } from 'lit-translate';\n\nimport '@material/mwc-button';\nimport '@material/mwc-dialog';\nimport '@material/mwc-icon';\nimport '@material/mwc-icon-button';\nimport '@material/mwc-icon-button-toggle';\nimport '@material/mwc-list';\nimport '@material/mwc-list/mwc-list-item';\nimport '@material/mwc-snackbar';\nimport { Dialog } from '@material/mwc-dialog';\nimport { Snackbar } from '@material/mwc-snackbar';\n\nimport '../filtered-list.js';\n\nimport {\n InfoDetail,\n InfoEntry,\n IssueDetail,\n IssueEvent,\n LogEntry,\n LogEntryType,\n LogEvent,\n} from '@compas-oscd/core';\n\nimport { getFilterIcon, iconColors } from '../icons/icons.js';\n\nimport { Plugin } from '../plugin.js';\nimport { XMLEditor } from '@openscd/oscd-editor';\n\nimport { getLogText } from './history/get-log-text.js';\n\ninterface HistoryItem {\n title: string;\n message?: string;\n time: number;\n isActive: boolean;\n}\n\nconst icons = {\n info: 'info',\n warning: 'warning',\n error: 'report',\n};\n\nfunction getPluginName(src: string): string {\n\n let storedPluginsString = localStorage.getItem('plugins');\n if(!storedPluginsString) {\n storedPluginsString = '[]';\n }\n\n const storedPlugins = JSON.parse(storedPluginsString) as Plugin[];\n const wantedPlugin = storedPlugins.find((p: Plugin) => p.src === src);\n\n if(!wantedPlugin) {\n return `pluginnotfound: ${src} in ${storedPluginsString}`;\n }\n\n const name = wantedPlugin.name;\n\n if(!name){\n return `pluginhasnoname:${src}`;\n }\n\n return name;\n\n}\n\nexport enum HistoryUIKind {\n log = 'log',\n history = 'history',\n diagnostic = 'diagnostic',\n}\nexport interface HistoryUIDetail {\n show: boolean;\n kind: HistoryUIKind;\n}\n\nexport type HistoryUIEvent = CustomEvent<HistoryUIDetail>;\n\nexport function newHistoryUIEvent(\n show: boolean,\n kind: HistoryUIKind,\n eventInitDict?: CustomEventInit<Partial<HistoryUIDetail>>\n): HistoryUIEvent {\n return new CustomEvent<HistoryUIDetail>('history-dialog-ui', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: {\n show,\n kind,\n ...eventInitDict?.detail,\n },\n });\n}\n\nexport interface EmptyIssuesDetail {\n pluginSrc: string;\n}\n\nexport type EmptyIssuesEvent = CustomEvent<EmptyIssuesDetail>;\n\nexport function newEmptyIssuesEvent(\n pluginSrc: string,\n eventInitDict?: CustomEventInit<Partial<EmptyIssuesDetail>>\n): EmptyIssuesEvent {\n return new CustomEvent<EmptyIssuesDetail>('empty-issues', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: { pluginSrc, ...eventInitDict?.detail },\n });\n}\n\n@customElement('oscd-history')\nexport class OscdHistory extends LitElement {\n /** All [[`LogEntry`]]s received so far through [[`LogEvent`]]s. */\n @property({ type: Array })\n log: InfoEntry[] = [];\n\n /** XML Editor to apply changes to the scd */\n @property({ type: Object }) editor!: XMLEditor;\n\n @property()\n diagnoses = new Map<string, IssueDetail[]>();\n\n @property({ type: Object })\n host!: HTMLElement;\n\n @state()\n latestIssue!: IssueDetail;\n\n @state()\n history: HistoryItem[] = [];\n\n @state()\n validationTimes = new Map<string, Date>();\n\n get canRedo(): boolean {\n return this.editor.future.length >= 1;\n }\n\n get canUndo(): boolean {\n return this.editor.past.length >= 1;\n }\n\n @query('#log') logUI!: Dialog;\n @query('#history') historyUI!: Dialog;\n @query('#diagnostic') diagnosticUI!: Dialog;\n @query('#error') errorUI!: Snackbar;\n @query('#warning') warningUI!: Snackbar;\n @query('#info') infoUI!: Snackbar;\n @query('#issue') issueUI!: Snackbar;\n\n private unsubscribers: (() => any)[] = [];\n\n private onIssue(de: IssueEvent): void {\n const issues = this.diagnoses.get(de.detail.validatorId);\n\n if (!issues) this.diagnoses.set(de.detail.validatorId, [de.detail]);\n else issues?.push(de.detail);\n\n this.validationTimes.set(de.detail.validatorId, new Date());\n\n this.latestIssue = de.detail;\n this.issueUI.close();\n this.issueUI.show();\n }\n\n undo(): void {\n this.editor.undo();\n }\n redo(): void {\n this.editor.redo();\n }\n\n private onReset() {\n this.log = [];\n this.diagnoses.clear();\n this.editor.past = [];\n this.editor.future = [];\n this.updateHistory();\n }\n\n private onInfo(detail: InfoDetail) {\n const entry: InfoEntry = {\n time: new Date(),\n ...detail,\n };\n\n this.log.push(entry);\n if (!this.logUI.open) {\n const ui = {\n error: this.errorUI,\n warning: this.warningUI,\n info: this.infoUI,\n }[detail.kind];\n\n ui.close();\n ui.show();\n }\n if (detail.kind == 'error') {\n this.errorUI.close(); // hack to reset timeout\n this.errorUI.show();\n }\n this.requestUpdate('log', []);\n }\n\n private onLog(le: LogEvent): void {\n switch (le.detail.kind) {\n case 'reset':\n this.onReset();\n break;\n case 'action':\n // No longer needed\n break;\n default:\n this.onInfo(le.detail);\n break;\n }\n }\n\n private historyUIHandler(e: HistoryUIEvent): void {\n const ui = {\n log: this.logUI,\n history: this.historyUI,\n diagnostic: this.diagnosticUI,\n }[e.detail.kind];\n\n if (e.detail.show) ui.show();\n else ui.close();\n }\n\n private emptyIssuesHandler(e: EmptyIssuesEvent): void {\n if (this.diagnoses.get(e.detail.pluginSrc))\n this.diagnoses.get(e.detail.pluginSrc)!.length = 0;\n }\n\n private handleKeyPress(e: KeyboardEvent): void {\n const ctrlAnd = (key: string) => e.key === key && e.ctrlKey;\n\n if (ctrlAnd('y')) this.redo();\n if (ctrlAnd('z')) this.undo();\n if (ctrlAnd('l')) this.logUI.open ? this.logUI.close() : this.logUI.show();\n if (ctrlAnd('d'))\n this.diagnosticUI.open\n ? this.diagnosticUI.close()\n : this.diagnosticUI.show();\n }\n\n private updateHistory(): void {\n const { past, future } = this.editor;\n\n const activeIndex = past.length - 1;\n const allEntries = [ ...past, ...future ];\n\n this.history = allEntries.map((e, index) => {\n const { title, message } = getLogText(e.redo as any);\n\n return {\n isActive: index === activeIndex,\n time: e.time,\n title: e.title ?? title,\n message\n };\n });\n }\n\n constructor() {\n super();\n this.undo = this.undo.bind(this);\n this.redo = this.redo.bind(this);\n this.onLog = this.onLog.bind(this);\n this.onIssue = this.onIssue.bind(this);\n this.historyUIHandler = this.historyUIHandler.bind(this);\n this.emptyIssuesHandler = this.emptyIssuesHandler.bind(this);\n this.handleKeyPress = this.handleKeyPress.bind(this);\n document.onkeydown = this.handleKeyPress;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.unsubscribers.push(\n this.editor.subscribe(() =>\n this.updateHistory()\n )\n );\n\n this.host.addEventListener('log', this.onLog);\n this.host.addEventListener('issue', this.onIssue);\n this.host.addEventListener('history-dialog-ui', this.historyUIHandler);\n this.host.addEventListener('empty-issues', this.emptyIssuesHandler);\n }\n\n disconnectedCallback(): void {\n this.unsubscribers.forEach(u => u());\n }\n\n renderLogEntry(\n entry: InfoEntry,\n index: number,\n log: LogEntry[]\n ): TemplateResult {\n return html` <abbr title=\"${entry.title}\">\n <mwc-list-item\n class=\"${entry.kind}\"\n graphic=\"icon\"\n ?twoline=${!!entry.message}\n >\n <span class=\"selectable-text\">\n <!-- FIXME: replace tt with mwc-chip asap -->\n <tt>${entry.time?.toLocaleString()}</tt>\n ${entry.title}</span\n >\n <span class=\"selectable-text\" slot=\"secondary\">${entry.message}</span>\n <mwc-icon\n slot=\"graphic\"\n style=\"--mdc-theme-text-icon-on-background:var(${iconColors[\n entry.kind\n ]})\"\n >${icons[entry.kind]}</mwc-icon\n >\n </mwc-list-item></abbr\n >`;\n }\n\n renderHistoryEntry(\n entry: HistoryItem\n ): TemplateResult {\n return html` <abbr title=\"${entry.title}\">\n <mwc-list-item\n ?twoline=${!!entry.message}\n ?activated=${entry.isActive}\n >\n <span>\n <tt>${this.formatTime(entry.time)}</tt>\n ${entry.title}\n </span>\n <span slot=\"secondary\">${entry.message}</span>\n </mwc-list-item>\n </abbr>`;\n }\n\n private formatTime(time: number): string {\n const date = new Date(time);\n const hours = date.getHours();\n const minutes = date.getMinutes();\n return `${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`\n }\n\n private formatValidationTime(time: number): string {\n const date = new Date(time);\n const dateStr = date.toLocaleDateString();\n const timeStr = date.toLocaleTimeString();\n return `${dateStr} ${timeStr}`;\n }\n\n private renderLog(): TemplateResult[] | TemplateResult {\n if (this.log.length > 0)\n return this.log.slice().reverse().map(this.renderLogEntry, this);\n else\n return html`<mwc-list-item disabled graphic=\"icon\">\n <span>${get('log.placeholder')}</span>\n <mwc-icon slot=\"graphic\">info</mwc-icon>\n </mwc-list-item>`;\n }\n\n private renderHistory(): TemplateResult[] | TemplateResult {\n if (this.history.length > 0)\n return this.history.slice().reverse().map(e => this.renderHistoryEntry(e));\n else\n return html`<mwc-list-item disabled graphic=\"icon\">\n <span>${get('history.placeholder')}</span>\n <mwc-icon slot=\"graphic\">info</mwc-icon>\n </mwc-list-item>`;\n }\n\n protected renderIssueEntry(issue: IssueDetail): TemplateResult {\n return html` <abbr title=\"${issue.title + '\\n' + issue.message}\"\n ><mwc-list-item noninteractive ?twoline=${!!issue.message}>\n <span class=\"selectable-text\"> ${issue.title}</span>\n <span class=\"selectable-text\" slot=\"secondary\">${issue.message}</span>\n </mwc-list-item></abbr\n >`;\n }\n\n renderValidatorsIssues(issues: IssueDetail[]): TemplateResult[] {\n if (issues.length === 0) return [html``];\n\n const lastValidated = this.validationTimes.get(issues[0].validatorId);\n\n return [\n html`\n <mwc-list-item noninteractive ?twoline=${!!lastValidated}>\n <span>${getPluginName(issues[0].validatorId)}</span>\n ${lastValidated\n ? html`<span slot=\"secondary\" class=\"validation-time\"\n >${get('diag.lastValidated', {\n time: this.formatValidationTime(lastValidated.getTime()),\n })}</span\n >`\n : ''}\n </span>\n </mwc-list-item>\n `,\n html`<li divider padded role=\"separator\"></li>`,\n ...issues.map(issue => this.renderIssueEntry(issue)),\n ];\n }\n\n private renderIssues(): TemplateResult[] | TemplateResult {\n const issueItems: TemplateResult[] = [];\n\n this.diagnoses.forEach(issues => {\n this.renderValidatorsIssues(issues).forEach(issueItem =>\n issueItems.push(issueItem)\n );\n });\n\n return issueItems.length\n ? issueItems\n : html`<mwc-list-item disabled graphic=\"icon\">\n <span>${get('diag.placeholder')}</span>\n <mwc-icon slot=\"graphic\">info</mwc-icon>\n </mwc-list-item>`;\n }\n\n private renderFilterButtons() {\n return (<LogEntryType[]>Object.keys(icons)).map(\n kind => html`<mwc-icon-button-toggle id=\"${kind}filter\" on\n >${getFilterIcon(kind, false)}\n ${getFilterIcon(kind, true)}</mwc-icon-button-toggle\n >`\n );\n }\n\n private renderLogDialog(): TemplateResult {\n return html` <mwc-dialog id=\"log\" heading=\"${get('log.name')}\">\n ${this.renderFilterButtons()}\n <mwc-list id=\"content\" wrapFocus>${this.renderLog()}</mwc-list>\n <mwc-button slot=\"primaryAction\" dialogaction=\"close\"\n >${get('close')}</mwc-button\n >\n </mwc-dialog>`;\n }\n\n private renderHistoryUI(): TemplateResult {\n return html` <mwc-dialog id=\"history\" heading=\"${get('history.name')}\">\n <mwc-list id=\"content\" wrapFocus>${this.renderHistory()}</mwc-list>\n <mwc-button\n icon=\"undo\"\n label=\"${get('undo')}\"\n ?disabled=${!this.canUndo}\n @click=${this.undo}\n slot=\"secondaryAction\"\n ></mwc-button>\n <mwc-button\n icon=\"redo\"\n label=\"${get('redo')}\"\n ?disabled=${!this.canRedo}\n @click=${this.redo}\n slot=\"secondaryAction\"\n ></mwc-button>\n <mwc-button slot=\"primaryAction\" dialogaction=\"close\"\n >${get('close')}</mwc-button\n >\n </mwc-dialog>`;\n }\n\n render(): TemplateResult {\n return html`<slot></slot>\n <style>\n .selectable-text {\n user-select: text;\n -webkit-user-select: text;\n cursor: text;\n }\n \n .validation-time {\n color: var(--base1);\n font-size: 0.85em;\n white-space: nowrap;\n }\n \n #log > mwc-icon-button-toggle {\n position: absolute;\n top: 8px;\n right: 14px;\n }\n #log > mwc-icon-button-toggle:nth-child(2) {\n right: 62px;\n }\n #log > mwc-icon-button-toggle:nth-child(3) {\n right: 110px;\n }\n #log > mwc-icon-button-toggle:nth-child(4) {\n right: 158px;\n }\n #content mwc-list-item.info,\n #content mwc-list-item.warning,\n #content mwc-list-item.error {\n display: none;\n }\n #infofilter[on] ~ #content mwc-list-item.info {\n display: flex;\n }\n #warningfilter[on] ~ #content mwc-list-item.warning {\n display: flex;\n }\n #errorfilter[on] ~ #content mwc-list-item.error {\n display: flex;\n }\n\n #infofilter[on] {\n color: var(--cyan);\n }\n\n #warningfilter[on] {\n color: var(--yellow);\n }\n\n #errorfilter[on] {\n color: var(--red);\n }\n\n #actionfilter[on] {\n color: var(--blue);\n }\n\n #log,\n #history {\n --mdc-dialog-min-width: 92vw;\n }\n\n #log > #filterContainer {\n position: absolute;\n top: 14px;\n right: 14px;\n }\n </style>\n ${this.renderLogDialog()} ${this.renderHistoryUI()}\n <mwc-dialog id=\"diagnostic\" heading=\"${get('diag.name')}\">\n <filtered-list id=\"content\" wrapFocus>\n ${this.renderIssues()}\n </filtered-list>\n <mwc-button slot=\"primaryAction\" dialogaction=\"close\">\n ${get('close')}\n </mwc-button>\n </mwc-dialog>\n\n <mwc-snackbar\n id=\"info\"\n timeoutMs=\"4000\"\n labelText=\"${this.log\n .slice()\n .reverse()\n .find(le => le.kind === 'info')?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>\n <mwc-snackbar\n id=\"warning\"\n timeoutMs=\"6000\"\n labelText=\"${this.log\n .slice()\n .reverse()\n .find(le => le.kind === 'warning')?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-button\n slot=\"action\"\n icon=\"history\"\n @click=${() => this.logUI.show()}\n >${get('log.snackbar.show')}</mwc-button\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>\n <mwc-snackbar\n id=\"error\"\n timeoutMs=\"10000\"\n labelText=\"${this.log\n .slice()\n .reverse()\n .find(le => le.kind === 'error')?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-button\n slot=\"action\"\n icon=\"history\"\n @click=${() => this.logUI.show()}\n >${get('log.snackbar.show')}</mwc-button\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>\n <mwc-snackbar\n id=\"issue\"\n timeoutMs=\"10000\"\n labelText=\"${this.latestIssue?.title ??\n get('log.snackbar.placeholder')}\"\n >\n <mwc-button\n slot=\"action\"\n icon=\"rule\"\n @click=${() => this.diagnosticUI.show()}\n >${get('log.snackbar.show')}</mwc-button\n >\n <mwc-icon-button icon=\"close\" slot=\"dismiss\"></mwc-icon-button>\n </mwc-snackbar>`;\n }\n}\n\ndeclare global {\n interface ElementEventMap {\n 'history-dialog-ui': CustomEvent<HistoryUIDetail>;\n 'empty-issues': CustomEvent<EmptyIssuesDetail>;\n }\n}\n"]}
@@ -248,6 +248,7 @@ let OscdLayout = class OscdLayout extends LitElement {
248
248
  if (!menuContentElement) {
249
249
  return;
250
250
  }
251
+ this.dispatchEvent(newEmptyIssuesEvent(src));
251
252
  return menuContentElement.validate();
252
253
  })).then();
253
254
  this.dispatchEvent(newPendingStateEvent(this.validated));
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/addons/Layout.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,KAAK,EAEL,KAAK,EACL,GAAG,GACJ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,OAAO,EAIL,WAAW,EAEZ,MAAM,gBAAgB,CAAC;AAQxB,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAG1C,OAAO,sBAAsB,CAAC;AAC9B,OA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,KAAK,EAAE;6CAA8C;AAC7C;IAAR,KAAK,EAAE;kDAAwB;AACvB;IAAR,KAAK,EAAE;gDAAgE;AAExD;IAAf,KAAK,CAAC,OAAO,CAAC;0CAAiB;AACT;IAAtB,KAAK,CAAC,cAAc,CAAC;+CAAoB;AACjB;IAAxB,KAAK,CAAC,gBAAgB,CAAC;4CAA8B;AAChC;IAArB,KAAK,CAAC,aAAa,CAAC;8CAAmB;AACnB;IAApB,KAAK,CAAC,YAAY,CAAC;oDAA2C;AA1BpD,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAspBtB;SAtpBY,UAAU","sourcesContent":["import {\n customElement,\n html,\n LitElement,\n property,\n state,\n TemplateResult,\n query,\n css,\n} from 'lit-element';\nimport { get } from 'lit-translate';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { newPendingStateEvent } from '@compas-oscd/core';\nimport { newSettingsUIEvent } from '@compas-oscd/core';\nimport { OscdApi } from '@compas-oscd/core';\nimport { XMLEditor } from '@openscd/oscd-editor';\nimport {\n MenuItem,\n Validator,\n MenuPlugin,\n pluginIcons,\n OpenSCD\n} from '../open-scd.js';\n\nimport {\n Plugin,\n ContentContext,\n PluginKind\n} from \"../plugin.js\"\n\nimport {\n HistoryUIKind,\n newEmptyIssuesEvent,\n newHistoryUIEvent\n} from './History.js';\nimport type { Drawer } from '@material/mwc-drawer';\nimport type { ActionDetail } from '@material/mwc-list';\nimport { List } from '@material/mwc-list';\nimport type { ListItem } from '@material/mwc-list/mwc-list-item';\n\nimport '@material/mwc-drawer';\nimport '@material/mwc-list';\nimport '@material/mwc-dialog';\nimport '@material/mwc-switch';\nimport '@material/mwc-select';\nimport '@material/mwc-textfield';\nimport { pluginTag } from '../plugin-tag.js';\n\nimport {OscdPluginManager} from \"./plugin-manager/plugin-manager.js\";\nimport \"./plugin-manager/plugin-manager.js\";\nimport {OscdCustomPluginDialog} from \"./plugin-manager/custom-plugin-dialog.js\";\nimport \"./plugin-manager/custom-plugin-dialog.js\";\nimport \"./menu-tabs/menu-tabs.js\";\nimport { TabActivatedEvent } from \"./menu-tabs/menu-tabs.js\";\n\n/**\n * This is a template literal tag function. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates\n *\n * Passes its arguments to LitElement's `html` tag after combining the first and\n * last expressions with the first two and last two static strings.\n * Throws unless the first and last expressions are identical strings.\n *\n * We need this to get around the expression location limitations documented in\n * https://lit.dev/docs/templates/expressions/#expression-locations\n *\n * After upgrading to Lit 2 we can use their static HTML functions instead:\n * https://lit.dev/docs/api/static-html/\n */\nfunction staticTagHtml(\n oldStrings: ReadonlyArray<string>,\n ...oldArgs: unknown[]\n): TemplateResult {\n const args = [...oldArgs];\n const firstArg = args.shift();\n const lastArg = args.pop();\n\n if (firstArg !== lastArg)\n throw new Error(\n `Opening tag <${firstArg}> does not match closing tag </${lastArg}>.`\n );\n\n const strings = [...oldStrings] as string[] & { raw: string[] };\n const firstString = strings.shift();\n const secondString = strings.shift();\n\n const lastString = strings.pop();\n const penultimateString = strings.pop();\n\n strings.unshift(`${firstString}${firstArg}${secondString}`);\n strings.push(`${penultimateString}${lastArg}${lastString}`);\n\n return html(<TemplateStringsArray>strings, ...args);\n}\n\ninterface RenderAblePlugin {\n src?: string;\n kind: string;\n content?: ContentContext;\n}\n\n@customElement('oscd-layout')\nexport class OscdLayout extends LitElement {\n\n /** The `XMLDocument` to be edited */\n @property({ attribute: false }) doc: XMLDocument | null = null;\n /** The name of the current [[`doc`]] */\n @property({ type: String }) docName = '';\n /** Index of the last [[`EditorAction`]] applied. */\n @property({ type: Number }) editCount = -1;\n\n /** XML Editor to apply changes to the scd */\n @property({ type: Object }) editor!: XMLEditor;\n\n /** The plugins to render the layout. */\n @property({ type: Array }) plugins: Plugin[] = [];\n\n /** The open-scd host element */\n @property({ type: Object }) host!: OpenSCD;\n\n @state() validated: Promise<void> = Promise.resolve();\n @state() shouldValidate = false;\n @state() activeEditor: Plugin | undefined = this.calcActiveEditors()[0];\n\n @query('#menu') menuUI!: Drawer;\n @query('#menuContent') menuContent!: List;\n @query('#pluginManager') pluginUI!: OscdPluginManager;\n @query('#pluginList') pluginList!: List;\n @query('#pluginAdd') pluginDownloadUI!: OscdCustomPluginDialog;\n\n\n render(): TemplateResult {\n return html`\n <div\n @open-plugin-download=${() => this.pluginDownloadUI.show()}\n @oscd-activate-editor=${this.handleActivateEditorByEvent}\n @oscd-run-menu=${this.handleRunMenuByEvent}\n >\n <slot></slot>\n ${this.renderHeader()} ${this.renderAside()} ${this.renderMenuContent()}\n ${this.renderContent()} ${this.renderLanding()} ${this.renderPlugging()}\n </div>\n `;\n }\n\n protected componentHtml(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult {\n return html(strings, ...values);\n }\n\n\n private renderPlugging(): TemplateResult {\n return html` ${this.renderPluginUI()} ${this.renderDownloadUI()} `;\n }\n\n private getMenuContent(src: string) {\n const tag = pluginTag(src);\n return this.menuContent.querySelector(tag);\n }\n\n /** Renders the \"Add Custom Plug-in\" UI*/\n protected renderDownloadUI(): TemplateResult {\n return html`\n <oscd-custom-plugin-dialog id=\"pluginAdd\"></oscd-custom-plugin-dialog>\n `\n }\n\n /**\n * Renders the plug-in management UI (turning plug-ins on/off)\n */\n protected renderPluginUI(): TemplateResult {\n return html`\n <oscd-plugin-manager id=\"pluginManager\" .plugins=${this.plugins}></oscd-plugin-manager>\n `\n }\n\n // Computed properties\n\n get validators(): Plugin[] {\n return this.plugins.filter(\n plugin => plugin.active && plugin.kind === 'validator'\n );\n }\n get menuEntries(): Plugin[] {\n return this.plugins.filter(\n plugin => plugin.active && plugin.kind === 'menu'\n );\n }\n get topMenu(): Plugin[] {\n return this.menuEntries.filter(plugin => plugin.position === 'top');\n }\n get middleMenu(): Plugin[] {\n return this.menuEntries.filter(plugin => plugin.position === 'middle');\n }\n get bottomMenu(): Plugin[] {\n return this.menuEntries.filter(plugin => plugin.position === 'bottom');\n }\n\n\n get menu(): (MenuItem | 'divider')[] {\n\n const topMenu = this.generateMenu(this.topMenu, 'top');\n const middleMenu = this.generateMenu(this.middleMenu, 'middle');\n const bottomMenu = this.generateMenu(this.bottomMenu, 'bottom');\n const validators = this.generateValidatorMenus(this.validators);\n const canUndo = this.editor.past.length > 0;\n const canRedo = this.editor.future.length > 0;\n\n if (middleMenu.length > 0) middleMenu.push('divider');\n if (bottomMenu.length > 0) bottomMenu.push('divider');\n\n return [\n 'divider',\n ...topMenu,\n 'divider',\n {\n icon: 'undo',\n name: 'undo',\n actionItem: true,\n action: (): void => {\n this.editor.undo();\n },\n disabled: (): boolean => !canUndo,\n kind: 'static',\n content: { tag: '' },\n },\n {\n icon: 'redo',\n name: 'redo',\n actionItem: true,\n action: (): void => {\n this.editor.redo();\n },\n disabled: (): boolean => !canRedo,\n kind: 'static',\n content: { tag: '' },\n },\n ...validators,\n {\n icon: 'list',\n name: 'menu.viewLog',\n actionItem: true,\n action: (): void => {\n this.dispatchEvent(newHistoryUIEvent(true, HistoryUIKind.log));\n },\n kind: 'static',\n content: { tag: '' },\n },\n {\n icon: 'history',\n name: 'menu.viewHistory',\n actionItem: true,\n action: (): void => {\n this.dispatchEvent(newHistoryUIEvent(true, HistoryUIKind.history));\n },\n kind: 'static',\n content: { tag: '' },\n },\n {\n icon: 'rule',\n name: 'menu.viewDiag',\n actionItem: true,\n action: (): void => {\n this.dispatchEvent(newHistoryUIEvent(true, HistoryUIKind.diagnostic));\n },\n kind: 'static',\n content: { tag: '' },\n },\n 'divider',\n ...middleMenu,\n {\n icon: 'settings',\n name: 'settings.title',\n action: (): void => {\n this.dispatchEvent(newSettingsUIEvent(true));\n },\n kind: 'static',\n content: { tag: '' },\n },\n ...bottomMenu,\n {\n icon: 'extension',\n name: 'plugins.heading',\n action: (): void => this.pluginUI.show(),\n kind: 'static',\n content: { tag: '' },\n },\n ];\n }\n\n get editors(): Plugin[] {\n return this.plugins.filter(\n plugin => plugin.active && plugin.kind === 'editor'\n );\n }\n\n // Keyboard Shortcuts\n private handleKeyPress(e: KeyboardEvent): void {\n // currently we only handley key shortcuts when users press ctrl\n if(!e.ctrlKey){ return }\n\n const keyFunctionMap: {[key:string]: () => void} = {\n 'm': () => this.menuUI.open = !this.menuUI.open,\n 'o': () => this.menuUI.querySelector<ListItem>('mwc-list-item[iconid=\"folder_open\"]')?.click(),\n 'O': () => this.menuUI.querySelector<ListItem>('mwc-list-item[iconid=\"create_new_folder\"]')?.click(),\n 's': () => this.menuUI.querySelector<ListItem>('mwc-list-item[iconid=\"save\"]')?.click(),\n 'P': () => this.pluginUI.show(),\n }\n\n const fn = keyFunctionMap[e.key];\n if(!fn){ return; }\n\n e.preventDefault();\n fn();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.host.addEventListener('close-drawer', async () => {\n this.menuUI.open = false;\n });\n this.host.addEventListener('validate', async () => {\n this.shouldValidate = true;\n await this.validated;\n\n if (!this.shouldValidate){ return; }\n\n this.shouldValidate = false;\n\n this.validated = Promise.allSettled(\n this.menuUI\n .querySelector('mwc-list')!\n .items.filter(item => item.className === 'validator')\n .map(item => {\n const src = item.dataset.src ?? '';\n const menuContentElement = this.getMenuContent(src);\n\n if (!menuContentElement) {\n return;\n }\n\n return (menuContentElement as unknown as Validator).validate()\n })\n ).then();\n this.dispatchEvent(newPendingStateEvent(this.validated));\n });\n this.handleKeyPress = this.handleKeyPress.bind(this);\n document.onkeydown = this.handleKeyPress;\n\n document.addEventListener(\"open-plugin-download\", () => {\n this.pluginDownloadUI.show();\n });\n }\n\n\n private generateMenu(plugins:Plugin[], kind: 'top' | 'middle' | 'bottom'): (MenuItem | 'divider')[]{\n return plugins.map(plugin => {\n return {\n icon: plugin.icon || pluginIcons['menu'],\n name: plugin.name,\n src: plugin.src,\n action: ae => {\n const menuContentElement = this.getMenuContent(plugin.src);\n if (!menuContentElement) {\n return;\n }\n\n this.dispatchEvent(newPendingStateEvent((menuContentElement as unknown as MenuPlugin).run()))\n },\n disabled: (): boolean => plugin.requireDoc! && this.doc === null,\n content: plugin.content ?? { tag: '' },\n kind: kind,\n }\n })\n }\n\n private generateValidatorMenus(plugins: Plugin[]): (MenuItem | 'divider')[] {\n return plugins.map(plugin =>{\n return {\n icon: plugin.icon || pluginIcons['validator'],\n name: plugin.name,\n src: plugin.src,\n action: ae => {\n this.dispatchEvent(newEmptyIssuesEvent(plugin.src));\n\n const menuContentElement = this.getMenuContent(plugin.src);\n if (!menuContentElement) {\n return;\n }\n\n this.dispatchEvent(newPendingStateEvent((menuContentElement as unknown as Validator).validate()))\n },\n disabled: (): boolean => this.doc === null,\n content: plugin.content ?? { tag: '' },\n kind: 'validator',\n }\n });\n }\n\n private renderMenuItem(me: MenuItem | 'divider'): TemplateResult {\n const isDivider = me === 'divider';\n const hasActionItem = me !== 'divider' && me.actionItem;\n\n if (isDivider) { return html`<li divider padded role=\"separator\"></li>`; }\n if (hasActionItem){ return html``; }\n return html`\n <mwc-list-item\n class=\"${me.kind}\"\n iconid=\"${me.icon}\"\n graphic=\"icon\"\n data-name=\"${me.name}\"\n data-src=\"${me.src ?? ''}\"\n .disabled=${me.disabled?.() || !me.action}\n ><mwc-icon slot=\"graphic\">${me.icon}</mwc-icon>\n <span>${get(me.name)}</span>\n ${me.hint\n ? html`<span slot=\"secondary\"><tt>${me.hint}</tt></span>`\n : ''}\n </mwc-list-item>\n `;\n }\n\n protected renderActionItem(me: MenuItem | 'divider'): TemplateResult {\n if(me === 'divider' || !me.actionItem){ return html`` }\n\n return html`\n <mwc-icon-button\n slot=\"actionItems\"\n icon=\"${me.icon}\"\n label=\"${me.name}\"\n ?disabled=${me.disabled?.() || !me.action}\n @click=${me.action}\n ></mwc-icon-button>`;\n }\n\n private renderEditorTab({ name, icon }: Plugin): TemplateResult {\n return html`<mwc-tab label=${name} icon=${icon || 'edit'}> </mwc-tab>`;\n }\n\n /** Renders top bar which features icon buttons for undo, redo, log, scl history and diagnostics*/\n protected renderHeader(): TemplateResult {\n return html`<mwc-top-app-bar-fixed>\n <mwc-icon-button\n icon=\"menu\"\n label=\"Menu\"\n slot=\"navigationIcon\"\n @click=${() => (this.menuUI.open = true)}\n ></mwc-icon-button>\n ${this.renderTitle()}\n ${this.renderActionItems()}\n </mwc-top-app-bar-fixed>`;\n }\n\n /**\n * Renders the title section in the top bar\n * Make sure to use slot=\"title\" for the returned template\n */\n protected renderTitle(): TemplateResult {\n return html`<div slot=\"title\" id=\"title\">${this.docName}</div>`;\n }\n\n /**\n * Renders the action items for the top bar\n * Make sure to use slot=\"actionItems\" for each element\n */\n protected renderActionItems(): TemplateResult {\n return html`${this.menu.map(this.renderActionItem)}`;\n }\n\n protected renderMenuContent(): TemplateResult {\n return html`\n <div id=\"menuContent\">\n ${\n this.menu\n .filter(p => (p as MenuItem).content)\n .map(p => this.renderPluginContent((p as MenuItem)))\n }\n </div>\n `;\n }\n\n /**\n * Renders a drawer toolbar featuring the scl filename, enabled menu plugins,\n * settings, help, scl history and plug-ins management\n */\n protected renderAside(): TemplateResult {\n\n return html`\n <mwc-drawer class=\"mdc-theme--surface\" hasheader type=\"modal\" id=\"menu\">\n <span slot=\"title\">${get('menu.title')}</span>\n ${renderTitle(this.docName)}\n <mwc-list\n wrapFocus\n @action=${makeListAction(this.menu)}\n >\n ${this.menu.map(this.renderMenuItem)}\n </mwc-list>\n </mwc-drawer>\n `;\n\n function renderTitle(docName?: string){\n if(!docName) return html``;\n\n return html`<span slot=\"subtitle\">${docName}</span>`;\n }\n\n function makeListAction(menuItems : (MenuItem|'divider')[]){\n return function listAction(ae: CustomEvent<ActionDetail>){\n //FIXME: dirty hack to be fixed in open-scd-core\n // if clause not necessary when oscd... components in open-scd not list\n if (ae.target instanceof List)\n (<MenuItem>(\n menuItems.filter(\n item => item !== 'divider' && !item.actionItem\n )[ae.detail.index]\n ))?.action?.(ae);\n }\n }\n\n\n }\n\n private calcActiveEditors(){\n const hasActiveDoc = Boolean(this.doc);\n\n return this.editors\n .filter(editor => {\n // this is necessary because `requireDoc` can be undefined\n // and that is not the same as false\n const doesNotRequireDoc = editor.requireDoc === false\n return doesNotRequireDoc || hasActiveDoc\n })\n }\n\n /** Renders the enabled editor plugins and a tab bar to switch between them*/\n protected renderContent(): TemplateResult {\n\n const activeEditors = this.calcActiveEditors()\n .map(this.renderEditorTab)\n\n const hasActiveEditors = activeEditors.length > 0;\n if(!hasActiveEditors){ return html``; }\n\n const renderEditorContent = (doc: XMLDocument | null, activeEditor?: Plugin) => {\n const editor = activeEditor;\n const requireDoc = editor?.requireDoc\n if(requireDoc && !doc) { return html`` }\n\n const tag = editor?.content?.tag;\n if(!tag) { return html`` }\n\n return this.renderPluginContent(editor);\n }\n\n return html`\n <oscd-menu-tabs\n .editors=${this.calcActiveEditors()}\n .activeEditor=${this.activeEditor}\n @oscd-editor-tab-activated=${this.handleEditorTabActivated}\n >\n </oscd-menu-tabs>\n ${renderEditorContent(this.doc, this.activeEditor, )}\n `;\n }\n\n private handleEditorTabActivated(e: TabActivatedEvent){\n this.activeEditor = e.detail.editor\n }\n\n private handleActivateEditorByEvent(e: CustomEvent<{name: string, src: string}>): void {\n const {name, src} = e.detail;\n const editors = this.calcActiveEditors()\n const wantedEditor = editors.find(editor => editor.name === name || editor.src === src)\n if(!wantedEditor){ return; } // TODO: log error\n\n this.activeEditor = wantedEditor;\n }\n\n private handleRunMenuByEvent(e: CustomEvent<{name: string}>): void {\n\n // TODO: this is a workaround, fix it\n this.menuUI.open = true;\n const menuEntry = this.menuUI.querySelector(`[data-name=\"${e.detail.name}\"]`) as HTMLElement\n\n const menuContentElement = this.getMenuContent(menuEntry.dataset.src ?? '');\n if (!menuContentElement) {\n return;\n }\n\n (menuContentElement as unknown as MenuPlugin).run();\n }\n\n /**\n * Renders the landing buttons (open project and new project)\n * it no document loaded we display the menu item that are in the position\n * 'top' and are not disabled\n *\n * To enable replacement of this part we have to convert it to either an addon\n * or a plugin\n */\n protected renderLanding(): TemplateResult {\n if(this.doc){ return html``; }\n\n return html`\n <div class=\"landing\">\n ${renderMenuItems(this.menu, this.menuUI)}\n </div>`\n\n function renderMenuItems(menuItemsAndDividers: (MenuItem | 'divider')[], menuUI: Drawer){\n\n const menuItems = menuItemsAndDividers.filter(mi => mi !== 'divider') as MenuItem[];\n\n return menuItems.map((mi: MenuItem, index) => {\n if(mi.kind !== 'top' || mi.disabled?.()) { return html``; }\n\n return html`\n <mwc-icon-button\n class=\"landing_icon\"\n icon=\"${mi.icon}\"\n @click=\"${() => clickListItem(index)}\"\n >\n <div class=\"landing_label\">${mi.name}</div>\n </mwc-icon-button>\n `\n })\n\n function clickListItem(index:number) {\n const listItem = menuUI.querySelector('mwc-list')!.items[index];\n listItem.click();\n }\n\n }\n }\n\n protected renderPluginContent(plugin: RenderAblePlugin): TemplateResult {\n const tag = plugin.content?.tag ?? '';\n\n if (!tag) {\n return html``;\n }\n\n const osdcApi = new OscdApi(tag);\n return staticTagHtml`<${tag}\n .doc=${this.doc}\n .docName=${this.docName}\n .editCount=${this.editCount}\n .plugins=${this.host.storedPlugins}\n .docId=${this.host.docId}\n .pluginId=${plugin.src}\n .nsdoc=${this.host.nsdoc}\n .docs=${this.host.docs}\n .locale=${this.host.locale}\n .oscdApi=${osdcApi}\n .editor=${this.editor}\n class=\"${classMap({\n plugin: true,\n menu: plugin.kind === 'menu',\n validator: plugin.kind === 'validator',\n editor: plugin.kind === 'editor',\n })}\"\n ></${tag}>`\n }\n\n\n\n\n static styles = css`\n mwc-drawer {\n position: absolute;\n top: 0;\n }\n\n mwc-top-app-bar-fixed {\n --mdc-theme-text-disabled-on-light: rgba(255, 255, 255, 0.38);\n } /* hack to fix disabled icon buttons rendering black */\n\n mwc-tab {\n background-color: var(--primary);\n --mdc-theme-primary: var(--mdc-theme-on-primary);\n }\n\n input[type='file'] {\n display: none;\n }\n\n mwc-dialog {\n --mdc-dialog-max-width: 98vw;\n }\n\n mwc-dialog > form {\n display: flex;\n flex-direction: column;\n }\n\n mwc-dialog > form > * {\n display: block;\n margin-top: 16px;\n }\n\n mwc-linear-progress {\n position: fixed;\n --mdc-linear-progress-buffer-color: var(--primary);\n --mdc-theme-primary: var(--secondary);\n left: 0px;\n top: 0px;\n width: 100%;\n pointer-events: none;\n z-index: 1000;\n }\n\n tt {\n font-family: 'Roboto Mono', monospace;\n font-weight: 300;\n }\n\n #menuContent {\n height: 0px;\n }\n\n .landing {\n position: absolute;\n text-align: center;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n }\n\n .landing_icon:hover {\n box-shadow: 0 12px 17px 2px rgba(0, 0, 0, 0.14),\n 0 5px 22px 4px rgba(0, 0, 0, 0.12), 0 7px 8px -4px rgba(0, 0, 0, 0.2);\n }\n\n .landing_icon {\n margin: 12px;\n border-radius: 16px;\n width: 160px;\n height: 140px;\n text-align: center;\n color: var(--mdc-theme-on-secondary);\n background: var(--secondary);\n --mdc-icon-button-size: 100px;\n --mdc-icon-size: 100px;\n --mdc-ripple-color: rgba(0, 0, 0, 0);\n box-shadow: rgb(0 0 0 / 14%) 0px 6px 10px 0px,\n rgb(0 0 0 / 12%) 0px 1px 18px 0px, rgb(0 0 0 / 20%) 0px 3px 5px -1px;\n transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .landing_label {\n width: 160px;\n height: 50px;\n margin-top: 100px;\n margin-left: -30px;\n font-family: 'Roboto', sans-serif;\n }\n\n .plugin.menu {\n display: flex;\n }\n\n .plugin.validator {\n display: flex;\n }\n `;\n}\n"]}
1
+ {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../src/addons/Layout.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,aAAa,EACb,IAAI,EACJ,UAAU,EACV,QAAQ,EACR,KAAK,EAEL,KAAK,EACL,GAAG,GACJ,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CA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KAAK,EAAE,CAAC;uCAAgC;AAEnC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAc;AAEb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6CAAgB;AAGf;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAoB;AAGpB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;2CAAwB;AAGtB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAgB;AAElC;IAAR,KAAK,EAAE;6CAA8C;AAC7C;IAAR,KAAK,EAAE;kDAAwB;AACvB;IAAR,KAAK,EAAE;gDAAgE;AAExD;IAAf,KAAK,CAAC,OAAO,CAAC;0CAAiB;AACT;IAAtB,KAAK,CAAC,cAAc,CAAC;+CAAoB;AACjB;IAAxB,KAAK,CAAC,gBAAgB,CAAC;4CAA8B;AAChC;IAArB,KAAK,CAAC,aAAa,CAAC;8CAAmB;AACnB;IAApB,KAAK,CAAC,YAAY,CAAC;oDAA2C;AA1BpD,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAwpBtB;SAxpBY,UAAU","sourcesContent":["import {\n customElement,\n html,\n LitElement,\n property,\n state,\n TemplateResult,\n query,\n css,\n} from 'lit-element';\nimport { get } from 'lit-translate';\nimport { classMap } from 'lit-html/directives/class-map.js';\nimport { newPendingStateEvent } from '@compas-oscd/core';\nimport { newSettingsUIEvent } from '@compas-oscd/core';\nimport { OscdApi } from '@compas-oscd/core';\nimport { XMLEditor } from '@openscd/oscd-editor';\nimport {\n MenuItem,\n Validator,\n MenuPlugin,\n pluginIcons,\n OpenSCD\n} from '../open-scd.js';\n\nimport {\n Plugin,\n ContentContext,\n PluginKind\n} from \"../plugin.js\"\n\nimport {\n HistoryUIKind,\n newEmptyIssuesEvent,\n newHistoryUIEvent\n} from './History.js';\nimport type { Drawer } from '@material/mwc-drawer';\nimport type { ActionDetail } from '@material/mwc-list';\nimport { List } from '@material/mwc-list';\nimport type { ListItem } from '@material/mwc-list/mwc-list-item';\n\nimport '@material/mwc-drawer';\nimport '@material/mwc-list';\nimport '@material/mwc-dialog';\nimport '@material/mwc-switch';\nimport '@material/mwc-select';\nimport '@material/mwc-textfield';\nimport { pluginTag } from '../plugin-tag.js';\n\nimport {OscdPluginManager} from \"./plugin-manager/plugin-manager.js\";\nimport \"./plugin-manager/plugin-manager.js\";\nimport {OscdCustomPluginDialog} from \"./plugin-manager/custom-plugin-dialog.js\";\nimport \"./plugin-manager/custom-plugin-dialog.js\";\nimport \"./menu-tabs/menu-tabs.js\";\nimport { TabActivatedEvent } from \"./menu-tabs/menu-tabs.js\";\n\n/**\n * This is a template literal tag function. See:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#tagged_templates\n *\n * Passes its arguments to LitElement's `html` tag after combining the first and\n * last expressions with the first two and last two static strings.\n * Throws unless the first and last expressions are identical strings.\n *\n * We need this to get around the expression location limitations documented in\n * https://lit.dev/docs/templates/expressions/#expression-locations\n *\n * After upgrading to Lit 2 we can use their static HTML functions instead:\n * https://lit.dev/docs/api/static-html/\n */\nfunction staticTagHtml(\n oldStrings: ReadonlyArray<string>,\n ...oldArgs: unknown[]\n): TemplateResult {\n const args = [...oldArgs];\n const firstArg = args.shift();\n const lastArg = args.pop();\n\n if (firstArg !== lastArg)\n throw new Error(\n `Opening tag <${firstArg}> does not match closing tag </${lastArg}>.`\n );\n\n const strings = [...oldStrings] as string[] & { raw: string[] };\n const firstString = strings.shift();\n const secondString = strings.shift();\n\n const lastString = strings.pop();\n const penultimateString = strings.pop();\n\n strings.unshift(`${firstString}${firstArg}${secondString}`);\n strings.push(`${penultimateString}${lastArg}${lastString}`);\n\n return html(<TemplateStringsArray>strings, ...args);\n}\n\ninterface RenderAblePlugin {\n src?: string;\n kind: string;\n content?: ContentContext;\n}\n\n@customElement('oscd-layout')\nexport class OscdLayout extends LitElement {\n\n /** The `XMLDocument` to be edited */\n @property({ attribute: false }) doc: XMLDocument | null = null;\n /** The name of the current [[`doc`]] */\n @property({ type: String }) docName = '';\n /** Index of the last [[`EditorAction`]] applied. */\n @property({ type: Number }) editCount = -1;\n\n /** XML Editor to apply changes to the scd */\n @property({ type: Object }) editor!: XMLEditor;\n\n /** The plugins to render the layout. */\n @property({ type: Array }) plugins: Plugin[] = [];\n\n /** The open-scd host element */\n @property({ type: Object }) host!: OpenSCD;\n\n @state() validated: Promise<void> = Promise.resolve();\n @state() shouldValidate = false;\n @state() activeEditor: Plugin | undefined = this.calcActiveEditors()[0];\n\n @query('#menu') menuUI!: Drawer;\n @query('#menuContent') menuContent!: List;\n @query('#pluginManager') pluginUI!: OscdPluginManager;\n @query('#pluginList') pluginList!: List;\n @query('#pluginAdd') pluginDownloadUI!: OscdCustomPluginDialog;\n\n\n render(): TemplateResult {\n return html`\n <div\n @open-plugin-download=${() => this.pluginDownloadUI.show()}\n @oscd-activate-editor=${this.handleActivateEditorByEvent}\n @oscd-run-menu=${this.handleRunMenuByEvent}\n >\n <slot></slot>\n ${this.renderHeader()} ${this.renderAside()} ${this.renderMenuContent()}\n ${this.renderContent()} ${this.renderLanding()} ${this.renderPlugging()}\n </div>\n `;\n }\n\n protected componentHtml(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult {\n return html(strings, ...values);\n }\n\n\n private renderPlugging(): TemplateResult {\n return html` ${this.renderPluginUI()} ${this.renderDownloadUI()} `;\n }\n\n private getMenuContent(src: string) {\n const tag = pluginTag(src);\n return this.menuContent.querySelector(tag);\n }\n\n /** Renders the \"Add Custom Plug-in\" UI*/\n protected renderDownloadUI(): TemplateResult {\n return html`\n <oscd-custom-plugin-dialog id=\"pluginAdd\"></oscd-custom-plugin-dialog>\n `\n }\n\n /**\n * Renders the plug-in management UI (turning plug-ins on/off)\n */\n protected renderPluginUI(): TemplateResult {\n return html`\n <oscd-plugin-manager id=\"pluginManager\" .plugins=${this.plugins}></oscd-plugin-manager>\n `\n }\n\n // Computed properties\n\n get validators(): Plugin[] {\n return this.plugins.filter(\n plugin => plugin.active && plugin.kind === 'validator'\n );\n }\n get menuEntries(): Plugin[] {\n return this.plugins.filter(\n plugin => plugin.active && plugin.kind === 'menu'\n );\n }\n get topMenu(): Plugin[] {\n return this.menuEntries.filter(plugin => plugin.position === 'top');\n }\n get middleMenu(): Plugin[] {\n return this.menuEntries.filter(plugin => plugin.position === 'middle');\n }\n get bottomMenu(): Plugin[] {\n return this.menuEntries.filter(plugin => plugin.position === 'bottom');\n }\n\n\n get menu(): (MenuItem | 'divider')[] {\n\n const topMenu = this.generateMenu(this.topMenu, 'top');\n const middleMenu = this.generateMenu(this.middleMenu, 'middle');\n const bottomMenu = this.generateMenu(this.bottomMenu, 'bottom');\n const validators = this.generateValidatorMenus(this.validators);\n const canUndo = this.editor.past.length > 0;\n const canRedo = this.editor.future.length > 0;\n\n if (middleMenu.length > 0) middleMenu.push('divider');\n if (bottomMenu.length > 0) bottomMenu.push('divider');\n\n return [\n 'divider',\n ...topMenu,\n 'divider',\n {\n icon: 'undo',\n name: 'undo',\n actionItem: true,\n action: (): void => {\n this.editor.undo();\n },\n disabled: (): boolean => !canUndo,\n kind: 'static',\n content: { tag: '' },\n },\n {\n icon: 'redo',\n name: 'redo',\n actionItem: true,\n action: (): void => {\n this.editor.redo();\n },\n disabled: (): boolean => !canRedo,\n kind: 'static',\n content: { tag: '' },\n },\n ...validators,\n {\n icon: 'list',\n name: 'menu.viewLog',\n actionItem: true,\n action: (): void => {\n this.dispatchEvent(newHistoryUIEvent(true, HistoryUIKind.log));\n },\n kind: 'static',\n content: { tag: '' },\n },\n {\n icon: 'history',\n name: 'menu.viewHistory',\n actionItem: true,\n action: (): void => {\n this.dispatchEvent(newHistoryUIEvent(true, HistoryUIKind.history));\n },\n kind: 'static',\n content: { tag: '' },\n },\n {\n icon: 'rule',\n name: 'menu.viewDiag',\n actionItem: true,\n action: (): void => {\n this.dispatchEvent(newHistoryUIEvent(true, HistoryUIKind.diagnostic));\n },\n kind: 'static',\n content: { tag: '' },\n },\n 'divider',\n ...middleMenu,\n {\n icon: 'settings',\n name: 'settings.title',\n action: (): void => {\n this.dispatchEvent(newSettingsUIEvent(true));\n },\n kind: 'static',\n content: { tag: '' },\n },\n ...bottomMenu,\n {\n icon: 'extension',\n name: 'plugins.heading',\n action: (): void => this.pluginUI.show(),\n kind: 'static',\n content: { tag: '' },\n },\n ];\n }\n\n get editors(): Plugin[] {\n return this.plugins.filter(\n plugin => plugin.active && plugin.kind === 'editor'\n );\n }\n\n // Keyboard Shortcuts\n private handleKeyPress(e: KeyboardEvent): void {\n // currently we only handley key shortcuts when users press ctrl\n if(!e.ctrlKey){ return }\n\n const keyFunctionMap: {[key:string]: () => void} = {\n 'm': () => this.menuUI.open = !this.menuUI.open,\n 'o': () => this.menuUI.querySelector<ListItem>('mwc-list-item[iconid=\"folder_open\"]')?.click(),\n 'O': () => this.menuUI.querySelector<ListItem>('mwc-list-item[iconid=\"create_new_folder\"]')?.click(),\n 's': () => this.menuUI.querySelector<ListItem>('mwc-list-item[iconid=\"save\"]')?.click(),\n 'P': () => this.pluginUI.show(),\n }\n\n const fn = keyFunctionMap[e.key];\n if(!fn){ return; }\n\n e.preventDefault();\n fn();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n this.host.addEventListener('close-drawer', async () => {\n this.menuUI.open = false;\n });\n this.host.addEventListener('validate', async () => {\n this.shouldValidate = true;\n await this.validated;\n\n if (!this.shouldValidate){ return; }\n\n this.shouldValidate = false;\n\n this.validated = Promise.allSettled(\n this.menuUI\n .querySelector('mwc-list')!\n .items.filter(item => item.className === 'validator')\n .map(item => {\n const src = item.dataset.src ?? '';\n const menuContentElement = this.getMenuContent(src);\n\n if (!menuContentElement) {\n return;\n }\n\n this.dispatchEvent(newEmptyIssuesEvent(src));\n\n return (menuContentElement as unknown as Validator).validate()\n })\n ).then();\n this.dispatchEvent(newPendingStateEvent(this.validated));\n });\n this.handleKeyPress = this.handleKeyPress.bind(this);\n document.onkeydown = this.handleKeyPress;\n\n document.addEventListener(\"open-plugin-download\", () => {\n this.pluginDownloadUI.show();\n });\n }\n\n\n private generateMenu(plugins:Plugin[], kind: 'top' | 'middle' | 'bottom'): (MenuItem | 'divider')[]{\n return plugins.map(plugin => {\n return {\n icon: plugin.icon || pluginIcons['menu'],\n name: plugin.name,\n src: plugin.src,\n action: ae => {\n const menuContentElement = this.getMenuContent(plugin.src);\n if (!menuContentElement) {\n return;\n }\n\n this.dispatchEvent(newPendingStateEvent((menuContentElement as unknown as MenuPlugin).run()))\n },\n disabled: (): boolean => plugin.requireDoc! && this.doc === null,\n content: plugin.content ?? { tag: '' },\n kind: kind,\n }\n })\n }\n\n private generateValidatorMenus(plugins: Plugin[]): (MenuItem | 'divider')[] {\n return plugins.map(plugin =>{\n return {\n icon: plugin.icon || pluginIcons['validator'],\n name: plugin.name,\n src: plugin.src,\n action: ae => {\n this.dispatchEvent(newEmptyIssuesEvent(plugin.src));\n\n const menuContentElement = this.getMenuContent(plugin.src);\n if (!menuContentElement) {\n return;\n }\n\n this.dispatchEvent(newPendingStateEvent((menuContentElement as unknown as Validator).validate()))\n },\n disabled: (): boolean => this.doc === null,\n content: plugin.content ?? { tag: '' },\n kind: 'validator',\n }\n });\n }\n\n private renderMenuItem(me: MenuItem | 'divider'): TemplateResult {\n const isDivider = me === 'divider';\n const hasActionItem = me !== 'divider' && me.actionItem;\n\n if (isDivider) { return html`<li divider padded role=\"separator\"></li>`; }\n if (hasActionItem){ return html``; }\n return html`\n <mwc-list-item\n class=\"${me.kind}\"\n iconid=\"${me.icon}\"\n graphic=\"icon\"\n data-name=\"${me.name}\"\n data-src=\"${me.src ?? ''}\"\n .disabled=${me.disabled?.() || !me.action}\n ><mwc-icon slot=\"graphic\">${me.icon}</mwc-icon>\n <span>${get(me.name)}</span>\n ${me.hint\n ? html`<span slot=\"secondary\"><tt>${me.hint}</tt></span>`\n : ''}\n </mwc-list-item>\n `;\n }\n\n protected renderActionItem(me: MenuItem | 'divider'): TemplateResult {\n if(me === 'divider' || !me.actionItem){ return html`` }\n\n return html`\n <mwc-icon-button\n slot=\"actionItems\"\n icon=\"${me.icon}\"\n label=\"${me.name}\"\n ?disabled=${me.disabled?.() || !me.action}\n @click=${me.action}\n ></mwc-icon-button>`;\n }\n\n private renderEditorTab({ name, icon }: Plugin): TemplateResult {\n return html`<mwc-tab label=${name} icon=${icon || 'edit'}> </mwc-tab>`;\n }\n\n /** Renders top bar which features icon buttons for undo, redo, log, scl history and diagnostics*/\n protected renderHeader(): TemplateResult {\n return html`<mwc-top-app-bar-fixed>\n <mwc-icon-button\n icon=\"menu\"\n label=\"Menu\"\n slot=\"navigationIcon\"\n @click=${() => (this.menuUI.open = true)}\n ></mwc-icon-button>\n ${this.renderTitle()}\n ${this.renderActionItems()}\n </mwc-top-app-bar-fixed>`;\n }\n\n /**\n * Renders the title section in the top bar\n * Make sure to use slot=\"title\" for the returned template\n */\n protected renderTitle(): TemplateResult {\n return html`<div slot=\"title\" id=\"title\">${this.docName}</div>`;\n }\n\n /**\n * Renders the action items for the top bar\n * Make sure to use slot=\"actionItems\" for each element\n */\n protected renderActionItems(): TemplateResult {\n return html`${this.menu.map(this.renderActionItem)}`;\n }\n\n protected renderMenuContent(): TemplateResult {\n return html`\n <div id=\"menuContent\">\n ${\n this.menu\n .filter(p => (p as MenuItem).content)\n .map(p => this.renderPluginContent((p as MenuItem)))\n }\n </div>\n `;\n }\n\n /**\n * Renders a drawer toolbar featuring the scl filename, enabled menu plugins,\n * settings, help, scl history and plug-ins management\n */\n protected renderAside(): TemplateResult {\n\n return html`\n <mwc-drawer class=\"mdc-theme--surface\" hasheader type=\"modal\" id=\"menu\">\n <span slot=\"title\">${get('menu.title')}</span>\n ${renderTitle(this.docName)}\n <mwc-list\n wrapFocus\n @action=${makeListAction(this.menu)}\n >\n ${this.menu.map(this.renderMenuItem)}\n </mwc-list>\n </mwc-drawer>\n `;\n\n function renderTitle(docName?: string){\n if(!docName) return html``;\n\n return html`<span slot=\"subtitle\">${docName}</span>`;\n }\n\n function makeListAction(menuItems : (MenuItem|'divider')[]){\n return function listAction(ae: CustomEvent<ActionDetail>){\n //FIXME: dirty hack to be fixed in open-scd-core\n // if clause not necessary when oscd... components in open-scd not list\n if (ae.target instanceof List)\n (<MenuItem>(\n menuItems.filter(\n item => item !== 'divider' && !item.actionItem\n )[ae.detail.index]\n ))?.action?.(ae);\n }\n }\n\n\n }\n\n private calcActiveEditors(){\n const hasActiveDoc = Boolean(this.doc);\n\n return this.editors\n .filter(editor => {\n // this is necessary because `requireDoc` can be undefined\n // and that is not the same as false\n const doesNotRequireDoc = editor.requireDoc === false\n return doesNotRequireDoc || hasActiveDoc\n })\n }\n\n /** Renders the enabled editor plugins and a tab bar to switch between them*/\n protected renderContent(): TemplateResult {\n\n const activeEditors = this.calcActiveEditors()\n .map(this.renderEditorTab)\n\n const hasActiveEditors = activeEditors.length > 0;\n if(!hasActiveEditors){ return html``; }\n\n const renderEditorContent = (doc: XMLDocument | null, activeEditor?: Plugin) => {\n const editor = activeEditor;\n const requireDoc = editor?.requireDoc\n if(requireDoc && !doc) { return html`` }\n\n const tag = editor?.content?.tag;\n if(!tag) { return html`` }\n\n return this.renderPluginContent(editor);\n }\n\n return html`\n <oscd-menu-tabs\n .editors=${this.calcActiveEditors()}\n .activeEditor=${this.activeEditor}\n @oscd-editor-tab-activated=${this.handleEditorTabActivated}\n >\n </oscd-menu-tabs>\n ${renderEditorContent(this.doc, this.activeEditor, )}\n `;\n }\n\n private handleEditorTabActivated(e: TabActivatedEvent){\n this.activeEditor = e.detail.editor\n }\n\n private handleActivateEditorByEvent(e: CustomEvent<{name: string, src: string}>): void {\n const {name, src} = e.detail;\n const editors = this.calcActiveEditors()\n const wantedEditor = editors.find(editor => editor.name === name || editor.src === src)\n if(!wantedEditor){ return; } // TODO: log error\n\n this.activeEditor = wantedEditor;\n }\n\n private handleRunMenuByEvent(e: CustomEvent<{name: string}>): void {\n\n // TODO: this is a workaround, fix it\n this.menuUI.open = true;\n const menuEntry = this.menuUI.querySelector(`[data-name=\"${e.detail.name}\"]`) as HTMLElement\n\n const menuContentElement = this.getMenuContent(menuEntry.dataset.src ?? '');\n if (!menuContentElement) {\n return;\n }\n\n (menuContentElement as unknown as MenuPlugin).run();\n }\n\n /**\n * Renders the landing buttons (open project and new project)\n * it no document loaded we display the menu item that are in the position\n * 'top' and are not disabled\n *\n * To enable replacement of this part we have to convert it to either an addon\n * or a plugin\n */\n protected renderLanding(): TemplateResult {\n if(this.doc){ return html``; }\n\n return html`\n <div class=\"landing\">\n ${renderMenuItems(this.menu, this.menuUI)}\n </div>`\n\n function renderMenuItems(menuItemsAndDividers: (MenuItem | 'divider')[], menuUI: Drawer){\n\n const menuItems = menuItemsAndDividers.filter(mi => mi !== 'divider') as MenuItem[];\n\n return menuItems.map((mi: MenuItem, index) => {\n if(mi.kind !== 'top' || mi.disabled?.()) { return html``; }\n\n return html`\n <mwc-icon-button\n class=\"landing_icon\"\n icon=\"${mi.icon}\"\n @click=\"${() => clickListItem(index)}\"\n >\n <div class=\"landing_label\">${mi.name}</div>\n </mwc-icon-button>\n `\n })\n\n function clickListItem(index:number) {\n const listItem = menuUI.querySelector('mwc-list')!.items[index];\n listItem.click();\n }\n\n }\n }\n\n protected renderPluginContent(plugin: RenderAblePlugin): TemplateResult {\n const tag = plugin.content?.tag ?? '';\n\n if (!tag) {\n return html``;\n }\n\n const osdcApi = new OscdApi(tag);\n return staticTagHtml`<${tag}\n .doc=${this.doc}\n .docName=${this.docName}\n .editCount=${this.editCount}\n .plugins=${this.host.storedPlugins}\n .docId=${this.host.docId}\n .pluginId=${plugin.src}\n .nsdoc=${this.host.nsdoc}\n .docs=${this.host.docs}\n .locale=${this.host.locale}\n .oscdApi=${osdcApi}\n .editor=${this.editor}\n class=\"${classMap({\n plugin: true,\n menu: plugin.kind === 'menu',\n validator: plugin.kind === 'validator',\n editor: plugin.kind === 'editor',\n })}\"\n ></${tag}>`\n }\n\n\n\n\n static styles = css`\n mwc-drawer {\n position: absolute;\n top: 0;\n }\n\n mwc-top-app-bar-fixed {\n --mdc-theme-text-disabled-on-light: rgba(255, 255, 255, 0.38);\n } /* hack to fix disabled icon buttons rendering black */\n\n mwc-tab {\n background-color: var(--primary);\n --mdc-theme-primary: var(--mdc-theme-on-primary);\n }\n\n input[type='file'] {\n display: none;\n }\n\n mwc-dialog {\n --mdc-dialog-max-width: 98vw;\n }\n\n mwc-dialog > form {\n display: flex;\n flex-direction: column;\n }\n\n mwc-dialog > form > * {\n display: block;\n margin-top: 16px;\n }\n\n mwc-linear-progress {\n position: fixed;\n --mdc-linear-progress-buffer-color: var(--primary);\n --mdc-theme-primary: var(--secondary);\n left: 0px;\n top: 0px;\n width: 100%;\n pointer-events: none;\n z-index: 1000;\n }\n\n tt {\n font-family: 'Roboto Mono', monospace;\n font-weight: 300;\n }\n\n #menuContent {\n height: 0px;\n }\n\n .landing {\n position: absolute;\n text-align: center;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 100%;\n }\n\n .landing_icon:hover {\n box-shadow: 0 12px 17px 2px rgba(0, 0, 0, 0.14),\n 0 5px 22px 4px rgba(0, 0, 0, 0.12), 0 7px 8px -4px rgba(0, 0, 0, 0.2);\n }\n\n .landing_icon {\n margin: 12px;\n border-radius: 16px;\n width: 160px;\n height: 140px;\n text-align: center;\n color: var(--mdc-theme-on-secondary);\n background: var(--secondary);\n --mdc-icon-button-size: 100px;\n --mdc-icon-size: 100px;\n --mdc-ripple-color: rgba(0, 0, 0, 0);\n box-shadow: rgb(0 0 0 / 14%) 0px 6px 10px 0px,\n rgb(0 0 0 / 12%) 0px 1px 18px 0px, rgb(0 0 0 / 20%) 0px 3px 5px -1px;\n transition: box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);\n }\n\n .landing_label {\n width: 160px;\n height: 50px;\n margin-top: 100px;\n margin-left: -30px;\n font-family: 'Roboto', sans-serif;\n }\n\n .plugin.menu {\n display: flex;\n }\n\n .plugin.validator {\n display: flex;\n }\n `;\n}\n"]}
@@ -1,13 +1,13 @@
1
- export const iec6185074 = fetch('public/xml/IEC_61850-7-4_2007B5.nsd')
1
+ export const iec6185074 = fetch('xml/IEC_61850-7-4_2007B5.nsd')
2
2
  .then(response => response.text())
3
3
  .then(str => new DOMParser().parseFromString(str, 'application/xml'));
4
- export const iec6185073 = fetch('public/xml/IEC_61850-7-3_2007B5.nsd')
4
+ export const iec6185073 = fetch('xml/IEC_61850-7-3_2007B5.nsd')
5
5
  .then(response => response.text())
6
6
  .then(str => new DOMParser().parseFromString(str, 'application/xml'));
7
- export const iec6185072 = fetch('public/xml/IEC_61850-7-2_2007B5.nsd')
7
+ export const iec6185072 = fetch('xml/IEC_61850-7-2_2007B5.nsd')
8
8
  .then(response => response.text())
9
9
  .then(str => new DOMParser().parseFromString(str, 'application/xml'));
10
- export const iec6185081 = fetch('public/xml/IEC_61850-8-1_2003A2.nsd')
10
+ export const iec6185081 = fetch('xml/IEC_61850-8-1_2003A2.nsd')
11
11
  .then(response => response.text())
12
12
  .then(str => new DOMParser().parseFromString(str, 'application/xml'));
13
13
  //# sourceMappingURL=nsd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nsd.js","sourceRoot":"","sources":["../../src/foundation/nsd.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,qCAAqC,CAAC;KACnE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,qCAAqC,CAAC;KACnE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,qCAAqC,CAAC;KACnE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,qCAAqC,CAAC;KACnE,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC","sourcesContent":["export const iec6185074 = fetch('public/xml/IEC_61850-7-4_2007B5.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n\nexport const iec6185073 = fetch('public/xml/IEC_61850-7-3_2007B5.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n\nexport const iec6185072 = fetch('public/xml/IEC_61850-7-2_2007B5.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n\nexport const iec6185081 = fetch('public/xml/IEC_61850-8-1_2003A2.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n"]}
1
+ {"version":3,"file":"nsd.js","sourceRoot":"","sources":["../../src/foundation/nsd.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,8BAA8B,CAAC;KAC5D,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,8BAA8B,CAAC;KAC5D,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,8BAA8B,CAAC;KAC5D,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC;AAExE,MAAM,CAAC,MAAM,UAAU,GAAG,KAAK,CAAC,8BAA8B,CAAC;KAC5D,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;KACjC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,SAAS,EAAE,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC","sourcesContent":["export const iec6185074 = fetch('xml/IEC_61850-7-4_2007B5.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n\nexport const iec6185073 = fetch('xml/IEC_61850-7-3_2007B5.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n\nexport const iec6185072 = fetch('xml/IEC_61850-7-2_2007B5.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n\nexport const iec6185081 = fetch('xml/IEC_61850-8-1_2003A2.nsd')\n .then(response => response.text())\n .then(str => new DOMParser().parseFromString(str, 'application/xml'));\n"]}
@@ -170,6 +170,7 @@ export const de = {
170
170
  zeroissues: 'Es konnten keine Fehler in dem Projekt gefunden werden.',
171
171
  placeholder: 'Hier werden Validierungsfehler angezeigt.',
172
172
  missingnsd: 'DataTypeTemplates können nicht validiert werden. Das Projekt muss die Version 2007B4 oder höher haben.',
173
+ lastValidated: 'Validiert um {{ time }}',
173
174
  },
174
175
  plugins: {
175
176
  heading: 'Plug-ins',