@compas-oscd/open-scd 0.34.1 → 0.34.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.
- package/dist/WizardDivider.d.ts +8 -0
- package/dist/Wizarding.d.ts +10 -0
- package/dist/Wizarding.js.map +1 -1
- package/dist/action-icon.d.ts +25 -0
- package/dist/action-pane.d.ts +25 -0
- package/dist/addons/Editor.d.ts +25 -0
- package/dist/addons/History.d.ts +86 -0
- package/dist/addons/Layout.d.ts +96 -0
- package/dist/addons/Settings.d.ts +68 -0
- package/dist/addons/Waiter.d.ts +14 -0
- package/dist/addons/Wizards.d.ts +15 -0
- package/dist/addons/editor/edit-action-to-v1-converter.d.ts +3 -0
- package/dist/addons/editor/edit-v1-to-v2-converter.d.ts +2 -0
- package/dist/addons/history/get-log-text.d.ts +5 -0
- package/dist/addons/menu-tabs/menu-tabs.d.ts +22 -0
- package/dist/addons/plugin-manager/custom-plugin-dialog.d.ts +28 -0
- package/dist/addons/plugin-manager/plugin-manager.d.ts +20 -0
- package/dist/filtered-list.d.ts +27 -0
- package/dist/finder-list.d.ts +37 -0
- package/dist/foundation/compare.d.ts +79 -0
- package/dist/foundation/dai.d.ts +30 -0
- package/dist/foundation/generators.d.ts +13 -0
- package/dist/foundation/ied.d.ts +22 -0
- package/dist/foundation/nsd.d.ts +4 -0
- package/dist/foundation/nsdoc.d.ts +14 -0
- package/dist/foundation/scl.d.ts +1 -0
- package/dist/foundation.d.ts +230 -0
- package/dist/icons/compare.d.ts +3 -0
- package/dist/icons/icons.d.ts +41 -0
- package/dist/icons/ied-icons.d.ts +3 -0
- package/dist/icons/lnode.d.ts +16 -0
- package/dist/open-scd.d.ts +131 -0
- package/dist/oscd-filter-button.d.ts +27 -0
- package/dist/plain-compare-list.d.ts +36 -0
- package/dist/plugin-tag.d.ts +6 -0
- package/dist/plugin.d.ts +23 -0
- package/dist/plugin.events.d.ts +15 -0
- package/dist/plugins.d.ts +3 -0
- package/dist/schemas.d.ts +58 -0
- package/dist/src/WizardDivider.d.ts +8 -0
- package/dist/src/WizardDivider.js.map +1 -0
- package/dist/src/Wizarding.d.ts +10 -0
- package/dist/src/Wizarding.js.map +1 -0
- package/dist/src/action-icon.d.ts +25 -0
- package/dist/src/action-icon.js.map +1 -0
- package/dist/src/action-pane.d.ts +25 -0
- package/dist/src/action-pane.js.map +1 -0
- package/dist/src/addons/Editor.d.ts +25 -0
- package/dist/src/addons/Editor.js.map +1 -0
- package/dist/src/addons/History.d.ts +86 -0
- package/dist/src/addons/History.js.map +1 -0
- package/dist/src/addons/Layout.d.ts +96 -0
- package/dist/src/addons/Layout.js.map +1 -0
- package/dist/src/addons/Settings.d.ts +68 -0
- package/dist/src/addons/Settings.js.map +1 -0
- package/dist/src/addons/Waiter.d.ts +14 -0
- package/dist/src/addons/Waiter.js.map +1 -0
- package/dist/src/addons/Wizards.d.ts +15 -0
- package/dist/src/addons/Wizards.js.map +1 -0
- package/dist/src/addons/editor/edit-action-to-v1-converter.d.ts +3 -0
- package/dist/src/addons/editor/edit-action-to-v1-converter.js.map +1 -0
- package/dist/src/addons/editor/edit-v1-to-v2-converter.d.ts +2 -0
- package/dist/src/addons/editor/edit-v1-to-v2-converter.js.map +1 -0
- package/dist/src/addons/history/get-log-text.d.ts +5 -0
- package/dist/src/addons/history/get-log-text.js.map +1 -0
- package/dist/src/addons/menu-tabs/menu-tabs.d.ts +22 -0
- package/dist/src/addons/menu-tabs/menu-tabs.js.map +1 -0
- package/dist/src/addons/plugin-manager/custom-plugin-dialog.d.ts +28 -0
- package/dist/src/addons/plugin-manager/custom-plugin-dialog.js.map +1 -0
- package/dist/src/addons/plugin-manager/plugin-manager.d.ts +20 -0
- package/dist/src/addons/plugin-manager/plugin-manager.js.map +1 -0
- package/dist/src/filtered-list.d.ts +27 -0
- package/dist/src/filtered-list.js.map +1 -0
- package/dist/src/finder-list.d.ts +37 -0
- package/dist/src/finder-list.js.map +1 -0
- package/dist/src/foundation/compare.d.ts +79 -0
- package/dist/src/foundation/compare.js.map +1 -0
- package/dist/src/foundation/dai.d.ts +30 -0
- package/dist/src/foundation/dai.js.map +1 -0
- package/dist/src/foundation/generators.d.ts +13 -0
- package/dist/src/foundation/generators.js.map +1 -0
- package/dist/src/foundation/ied.d.ts +22 -0
- package/dist/src/foundation/ied.js.map +1 -0
- package/dist/src/foundation/nsd.d.ts +4 -0
- package/dist/src/foundation/nsd.js.map +1 -0
- package/dist/src/foundation/nsdoc.d.ts +14 -0
- package/dist/src/foundation/nsdoc.js.map +1 -0
- package/dist/src/foundation/scl.d.ts +1 -0
- package/dist/src/foundation/scl.js.map +1 -0
- package/dist/src/foundation.d.ts +230 -0
- package/dist/src/foundation.js.map +1 -0
- package/dist/src/icons/compare.d.ts +3 -0
- package/dist/src/icons/compare.js.map +1 -0
- package/dist/src/icons/icons.d.ts +41 -0
- package/dist/src/icons/icons.js.map +1 -0
- package/dist/src/icons/ied-icons.d.ts +3 -0
- package/dist/src/icons/ied-icons.js.map +1 -0
- package/dist/src/icons/lnode.d.ts +16 -0
- package/dist/src/icons/lnode.js.map +1 -0
- package/dist/src/open-scd.d.ts +131 -0
- package/dist/src/open-scd.js.map +1 -0
- package/dist/src/oscd-filter-button.d.ts +27 -0
- package/dist/src/oscd-filter-button.js.map +1 -0
- package/dist/src/plain-compare-list.d.ts +36 -0
- package/dist/src/plain-compare-list.js.map +1 -0
- package/dist/src/plugin-tag.d.ts +6 -0
- package/dist/src/plugin-tag.js.map +1 -0
- package/dist/src/plugin.d.ts +23 -0
- package/dist/src/plugin.events.d.ts +15 -0
- package/dist/src/plugin.events.js.map +1 -0
- package/dist/src/plugin.js.map +1 -0
- package/dist/src/plugins.d.ts +3 -0
- package/dist/src/plugins.js.map +1 -0
- package/dist/src/schemas.d.ts +58 -0
- package/dist/src/schemas.js.map +1 -0
- package/dist/src/themes.d.ts +3 -0
- package/dist/src/themes.js.map +1 -0
- package/dist/src/translations/de.d.ts +2 -0
- package/dist/src/translations/de.js.map +1 -0
- package/dist/src/translations/en.d.ts +963 -0
- package/dist/src/translations/en.js.map +1 -0
- package/dist/src/translations/loader.d.ts +12 -0
- package/dist/src/translations/loader.js.map +1 -0
- package/dist/src/wizard-checkbox.d.ts +37 -0
- package/dist/src/wizard-checkbox.js.map +1 -0
- package/dist/src/wizard-dialog.d.ts +45 -0
- package/dist/src/wizard-dialog.js.map +1 -0
- package/dist/src/wizard-select.d.ts +31 -0
- package/dist/src/wizard-select.js.map +1 -0
- package/dist/src/wizard-textfield.d.ts +50 -0
- package/dist/src/wizard-textfield.js.map +1 -0
- package/dist/src/wizards.d.ts +23 -0
- package/dist/src/wizards.js.map +1 -0
- package/dist/test/foundation.d.ts +34 -0
- package/dist/test/foundation.js +55 -0
- package/dist/test/foundation.js.map +1 -0
- package/dist/test/mock-editor-logger.d.ts +16 -0
- package/dist/test/mock-editor-logger.js +53 -0
- package/dist/test/mock-editor-logger.js.map +1 -0
- package/dist/test/mock-edits.d.ts +7 -0
- package/dist/test/mock-edits.js +12 -0
- package/dist/test/mock-edits.js.map +1 -0
- package/dist/test/mock-open-scd.d.ts +22 -0
- package/dist/test/mock-open-scd.js +53 -0
- package/dist/test/mock-open-scd.js.map +1 -0
- package/dist/test/mock-plugins.d.ts +33 -0
- package/dist/test/mock-plugins.js +239 -0
- package/dist/test/mock-plugins.js.map +1 -0
- package/dist/test/mock-wizard-editor.d.ts +15 -0
- package/dist/test/mock-wizard-editor.js +50 -0
- package/dist/test/mock-wizard-editor.js.map +1 -0
- package/dist/themes.d.ts +3 -0
- package/dist/translations/de.d.ts +2 -0
- package/dist/translations/en.d.ts +963 -0
- package/dist/translations/loader.d.ts +12 -0
- package/dist/wizard-checkbox.d.ts +37 -0
- package/dist/wizard-dialog.d.ts +45 -0
- package/dist/wizard-select.d.ts +31 -0
- package/dist/wizard-textfield.d.ts +50 -0
- package/dist/wizards.d.ts +23 -0
- package/package.json +42 -22
- package/dist/core/api/api.js +0 -7
- package/dist/core/api/api.js.map +0 -1
- package/dist/core/api/editor/subject.js +0 -22
- package/dist/core/api/editor/subject.js.map +0 -1
- package/dist/core/api/editor/xml-editor.js +0 -82
- package/dist/core/api/editor/xml-editor.js.map +0 -1
- package/dist/core/api/plugin-state-api.js +0 -27
- package/dist/core/api/plugin-state-api.js.map +0 -1
- package/dist/core/foundation/cyrb64.js +0 -26
- package/dist/core/foundation/cyrb64.js.map +0 -1
- package/dist/core/foundation/deprecated/edit-event.js +0 -44
- package/dist/core/foundation/deprecated/edit-event.js.map +0 -1
- package/dist/core/foundation/deprecated/editor.js +0 -94
- package/dist/core/foundation/deprecated/editor.js.map +0 -1
- package/dist/core/foundation/deprecated/history.js +0 -17
- package/dist/core/foundation/deprecated/history.js.map +0 -1
- package/dist/core/foundation/deprecated/open-event.js +0 -9
- package/dist/core/foundation/deprecated/open-event.js.map +0 -1
- package/dist/core/foundation/deprecated/settings.js +0 -19
- package/dist/core/foundation/deprecated/settings.js.map +0 -1
- package/dist/core/foundation/deprecated/validation.js +0 -8
- package/dist/core/foundation/deprecated/validation.js.map +0 -1
- package/dist/core/foundation/deprecated/waiter.js +0 -12
- package/dist/core/foundation/deprecated/waiter.js.map +0 -1
- package/dist/core/foundation/edit-completed-event.js +0 -11
- package/dist/core/foundation/edit-completed-event.js.map +0 -1
- package/dist/core/foundation/edit-event.js +0 -8
- package/dist/core/foundation/edit-event.js.map +0 -1
- package/dist/core/foundation/edit.js +0 -31
- package/dist/core/foundation/edit.js.map +0 -1
- package/dist/core/foundation/handle-edit.js +0 -151
- package/dist/core/foundation/handle-edit.js.map +0 -1
- package/dist/core/foundation/open-event.js +0 -8
- package/dist/core/foundation/open-event.js.map +0 -1
- package/dist/core/foundation/plugin.js.map +0 -1
- package/dist/core/foundation.js +0 -14
- package/dist/core/foundation.js.map +0 -1
- package/dist/core/locales.js +0 -21
- package/dist/core/locales.js.map +0 -1
- package/dist/openscd/src/WizardDivider.js.map +0 -1
- package/dist/openscd/src/Wizarding.js.map +0 -1
- package/dist/openscd/src/action-icon.js.map +0 -1
- package/dist/openscd/src/action-pane.js.map +0 -1
- package/dist/openscd/src/addons/Editor.js.map +0 -1
- package/dist/openscd/src/addons/History.js.map +0 -1
- package/dist/openscd/src/addons/Layout.js.map +0 -1
- package/dist/openscd/src/addons/Settings.js.map +0 -1
- package/dist/openscd/src/addons/Waiter.js.map +0 -1
- package/dist/openscd/src/addons/Wizards.js.map +0 -1
- package/dist/openscd/src/addons/editor/edit-action-to-v1-converter.js.map +0 -1
- package/dist/openscd/src/addons/editor/edit-v1-to-v2-converter.js.map +0 -1
- package/dist/openscd/src/addons/history/get-log-text.js.map +0 -1
- package/dist/openscd/src/addons/menu-tabs/menu-tabs.js.map +0 -1
- package/dist/openscd/src/addons/plugin-manager/custom-plugin-dialog.js.map +0 -1
- package/dist/openscd/src/addons/plugin-manager/plugin-manager.js.map +0 -1
- package/dist/openscd/src/filtered-list.js.map +0 -1
- package/dist/openscd/src/finder-list.js.map +0 -1
- package/dist/openscd/src/foundation/compare.js.map +0 -1
- package/dist/openscd/src/foundation/dai.js.map +0 -1
- package/dist/openscd/src/foundation/generators.js.map +0 -1
- package/dist/openscd/src/foundation/ied.js.map +0 -1
- package/dist/openscd/src/foundation/nsd.js.map +0 -1
- package/dist/openscd/src/foundation/nsdoc.js.map +0 -1
- package/dist/openscd/src/foundation/scl.js.map +0 -1
- package/dist/openscd/src/foundation.js.map +0 -1
- package/dist/openscd/src/icons/compare.js.map +0 -1
- package/dist/openscd/src/icons/icons.js.map +0 -1
- package/dist/openscd/src/icons/ied-icons.js.map +0 -1
- package/dist/openscd/src/icons/lnode.js.map +0 -1
- package/dist/openscd/src/open-scd.js.map +0 -1
- package/dist/openscd/src/oscd-filter-button.js.map +0 -1
- package/dist/openscd/src/plain-compare-list.js.map +0 -1
- package/dist/openscd/src/plugin-tag.js.map +0 -1
- package/dist/openscd/src/plugin.events.js.map +0 -1
- package/dist/openscd/src/plugin.js +0 -2
- package/dist/openscd/src/plugin.js.map +0 -1
- package/dist/openscd/src/plugins.js.map +0 -1
- package/dist/openscd/src/schemas.js.map +0 -1
- package/dist/openscd/src/themes.js.map +0 -1
- package/dist/openscd/src/translations/de.js.map +0 -1
- package/dist/openscd/src/translations/en.js.map +0 -1
- package/dist/openscd/src/translations/loader.js.map +0 -1
- package/dist/openscd/src/wizard-checkbox.js.map +0 -1
- package/dist/openscd/src/wizard-dialog.js.map +0 -1
- package/dist/openscd/src/wizard-select.js.map +0 -1
- package/dist/openscd/src/wizard-textfield.js.map +0 -1
- package/dist/openscd/src/wizards.js.map +0 -1
- package/dist/xml/src/foundation.js +0 -67
- package/dist/xml/src/foundation.js.map +0 -1
- package/dist/xml/src/index.js +0 -2
- package/dist/xml/src/index.js.map +0 -1
- /package/dist/{openscd/src → src}/WizardDivider.js +0 -0
- /package/dist/{openscd/src → src}/Wizarding.js +0 -0
- /package/dist/{openscd/src → src}/action-icon.js +0 -0
- /package/dist/{openscd/src → src}/action-pane.js +0 -0
- /package/dist/{openscd/src → src}/addons/Editor.js +0 -0
- /package/dist/{openscd/src → src}/addons/History.js +0 -0
- /package/dist/{openscd/src → src}/addons/Layout.js +0 -0
- /package/dist/{openscd/src → src}/addons/Settings.js +0 -0
- /package/dist/{openscd/src → src}/addons/Waiter.js +0 -0
- /package/dist/{openscd/src → src}/addons/Wizards.js +0 -0
- /package/dist/{openscd/src → src}/addons/editor/edit-action-to-v1-converter.js +0 -0
- /package/dist/{openscd/src → src}/addons/editor/edit-v1-to-v2-converter.js +0 -0
- /package/dist/{openscd/src → src}/addons/history/get-log-text.js +0 -0
- /package/dist/{openscd/src → src}/addons/menu-tabs/menu-tabs.js +0 -0
- /package/dist/{openscd/src → src}/addons/plugin-manager/custom-plugin-dialog.js +0 -0
- /package/dist/{openscd/src → src}/addons/plugin-manager/plugin-manager.js +0 -0
- /package/dist/{openscd/src → src}/filtered-list.js +0 -0
- /package/dist/{openscd/src → src}/finder-list.js +0 -0
- /package/dist/{openscd/src → src}/foundation/compare.js +0 -0
- /package/dist/{openscd/src → src}/foundation/dai.js +0 -0
- /package/dist/{openscd/src → src}/foundation/generators.js +0 -0
- /package/dist/{openscd/src → src}/foundation/ied.js +0 -0
- /package/dist/{openscd/src → src}/foundation/nsd.js +0 -0
- /package/dist/{openscd/src → src}/foundation/nsdoc.js +0 -0
- /package/dist/{openscd/src → src}/foundation/scl.js +0 -0
- /package/dist/{openscd/src → src}/foundation.js +0 -0
- /package/dist/{openscd/src → src}/icons/compare.js +0 -0
- /package/dist/{openscd/src → src}/icons/icons.js +0 -0
- /package/dist/{openscd/src → src}/icons/ied-icons.js +0 -0
- /package/dist/{openscd/src → src}/icons/lnode.js +0 -0
- /package/dist/{openscd/src → src}/open-scd.js +0 -0
- /package/dist/{openscd/src → src}/oscd-filter-button.js +0 -0
- /package/dist/{openscd/src → src}/plain-compare-list.js +0 -0
- /package/dist/{openscd/src → src}/plugin-tag.js +0 -0
- /package/dist/{openscd/src → src}/plugin.events.js +0 -0
- /package/dist/{core/foundation → src}/plugin.js +0 -0
- /package/dist/{openscd/src → src}/plugins.js +0 -0
- /package/dist/{openscd/src → src}/schemas.js +0 -0
- /package/dist/{openscd/src → src}/themes.js +0 -0
- /package/dist/{openscd/src → src}/translations/de.js +0 -0
- /package/dist/{openscd/src → src}/translations/en.js +0 -0
- /package/dist/{openscd/src → src}/translations/loader.js +0 -0
- /package/dist/{openscd/src → src}/wizard-checkbox.js +0 -0
- /package/dist/{openscd/src → src}/wizard-dialog.js +0 -0
- /package/dist/{openscd/src → src}/wizard-select.js +0 -0
- /package/dist/{openscd/src → src}/wizard-textfield.js +0 -0
- /package/dist/{openscd/src → src}/wizards.js +0 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Determine which part of the Template Structure still needs to be initialized.
|
|
3
|
+
* With the first call the parent will normally be the LN(0) Element to start from.
|
|
4
|
+
* It will use the list to pop the first element and look if there is a DOI/SDI/DAI
|
|
5
|
+
* Element available with the same name.
|
|
6
|
+
*
|
|
7
|
+
* @param parentElement - The element to search from for a DOI/SDI/DAI
|
|
8
|
+
* @param templateStructure - The templates structure with DO/DA/BDA Elements.
|
|
9
|
+
* @returns The last element initialized element or LN(0) if nothing is initialized. This Element can be used to
|
|
10
|
+
* add the new element to. And the list of Template Elements that still need to be initialized.
|
|
11
|
+
*/
|
|
12
|
+
export declare function determineUninitializedStructure(parentElement: Element, templateStructure: Element[]): [Element, Element[]];
|
|
13
|
+
/**
|
|
14
|
+
* Create a new instance structure defined by the array of template elements passed.
|
|
15
|
+
*
|
|
16
|
+
* @param uninitializedTemplateStructure - The Array of Template Elements for which new instance elements need to be
|
|
17
|
+
* created.
|
|
18
|
+
* @returns The Element created from the last Template Element in the Array.
|
|
19
|
+
*/
|
|
20
|
+
export declare function initializeElements(uninitializedTemplateStructure: Element[]): Element;
|
|
21
|
+
/**
|
|
22
|
+
* Use the path configuration of a Common Data Class to search for all DO/SDO/DA/BDA Elements to create
|
|
23
|
+
* a structure for which DOI/SDI/DAI Elements should be created later. Null will be returned when an invalid
|
|
24
|
+
* Template Structure is described by the path.
|
|
25
|
+
*
|
|
26
|
+
* @param lnElement - The LN Element to use for searching the starting DO Element.
|
|
27
|
+
* @param path - The (S)DO/(B)DA Elements to find in the template structure.
|
|
28
|
+
* @returns List of Elements starting with the DO Element followed by one or more SDO or (B)DA Elements describing the structure.
|
|
29
|
+
*/
|
|
30
|
+
export declare function createTemplateStructure(lnElement: Element, path: string[]): Element[] | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @param doc - project xml document
|
|
3
|
+
* @param serviceType - SampledValueControl (SMV) or GSEControl (GSE)
|
|
4
|
+
* @returns a function generating increasing unused `MAC-Address` within `doc` on subsequent invocations
|
|
5
|
+
*/
|
|
6
|
+
export declare function mACAddressGenerator(doc: XMLDocument, serviceType: 'SMV' | 'GSE'): () => string;
|
|
7
|
+
/**
|
|
8
|
+
* @param doc - project xml document
|
|
9
|
+
* @param serviceType - SampledValueControl (SMV) or GSEControl (GSE)
|
|
10
|
+
* @param type1A - whether the GOOSE is a Trip GOOSE resulting in different APPID range - default false
|
|
11
|
+
* @returns a function generating increasing unused `APPID` within `doc` on subsequent invocations
|
|
12
|
+
*/
|
|
13
|
+
export declare function appIdGenerator(doc: XMLDocument, serviceType: 'SMV' | 'GSE', type1A?: boolean): () => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Delete } from '@openscd/core/foundation/deprecated/editor.js';
|
|
2
|
+
/**
|
|
3
|
+
* Get all the FCDA attributes containing values from a specific element.
|
|
4
|
+
*
|
|
5
|
+
* @param elementContainingFcdaReferences - The element to use
|
|
6
|
+
* @returns FCDA references
|
|
7
|
+
*/
|
|
8
|
+
export declare function getFcdaReferences(elementContainingFcdaReferences: Element): string;
|
|
9
|
+
/**
|
|
10
|
+
* Get all the Control attributes containing values from a specific element.
|
|
11
|
+
*
|
|
12
|
+
* @param extRef - The element to use
|
|
13
|
+
* @returns Control references
|
|
14
|
+
*/
|
|
15
|
+
export declare function getControlReferences(extRef: Element): string;
|
|
16
|
+
/**
|
|
17
|
+
* Creating Delete actions in case Inputs elements are empty.
|
|
18
|
+
*
|
|
19
|
+
* @param extRefDeleteActions - All Delete actions for ExtRefs.
|
|
20
|
+
* @returns Possible delete actions for empty Inputs elements.
|
|
21
|
+
*/
|
|
22
|
+
export declare function emptyInputsDeleteActions(extRefDeleteActions: Delete[]): Delete[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface Nsdoc {
|
|
2
|
+
nsdoc72?: XMLDocument;
|
|
3
|
+
nsdoc73?: XMLDocument;
|
|
4
|
+
nsdoc74?: XMLDocument;
|
|
5
|
+
nsdoc81?: XMLDocument;
|
|
6
|
+
getDataDescription: (element: Element, ancestors?: Element[]) => {
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Initialize the full Nsdoc object.
|
|
12
|
+
* @returns A fully initialized Nsdoc object for wizards/editors to use.
|
|
13
|
+
*/
|
|
14
|
+
export declare function initializeNsdoc(): Nsdoc;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function existFcdaReference(fcda: Element, ied: Element): boolean;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit-element';
|
|
2
|
+
import { Part } from 'lit-html';
|
|
3
|
+
import { List } from '@material/mwc-list';
|
|
4
|
+
import { Select } from '@material/mwc-select';
|
|
5
|
+
import { TextField } from '@material/mwc-textfield';
|
|
6
|
+
import AceEditor from 'ace-custom-element';
|
|
7
|
+
import { WizardTextField } from './wizard-textfield.js';
|
|
8
|
+
import { WizardSelect } from './wizard-select.js';
|
|
9
|
+
import { EditorAction } from '@openscd/core/foundation/deprecated/editor.js';
|
|
10
|
+
export declare const wizardInputSelector = "wizard-textfield, mwc-textfield, ace-editor, mwc-select, wizard-select, wizard-checkbox";
|
|
11
|
+
export type WizardInputElement = WizardTextField | TextField | (AceEditor & {
|
|
12
|
+
checkValidity: () => boolean;
|
|
13
|
+
validityTransform: (newValue: string, nativeValidity: ValidityState) => ValidityState;
|
|
14
|
+
validationMessage: string;
|
|
15
|
+
validity: ValidityState;
|
|
16
|
+
label: string;
|
|
17
|
+
requestUpdate(name?: PropertyKey, oldValue?: unknown): Promise<unknown>;
|
|
18
|
+
}) | Select | WizardSelect;
|
|
19
|
+
export type WizardAction = EditorAction | WizardFactory;
|
|
20
|
+
/** @returns [[`EditorAction`]]s to dispatch on [[`WizardDialog`]] commit. */
|
|
21
|
+
export type WizardActor = (inputs: WizardInputElement[], wizard: Element, list?: List | null) => WizardAction[];
|
|
22
|
+
export declare function isWizardFactory(maybeFactory: WizardAction | Wizard | null): maybeFactory is WizardFactory;
|
|
23
|
+
/** @returns the validity of `input` depending on type. */
|
|
24
|
+
export declare function checkValidity(input: WizardInputElement): boolean;
|
|
25
|
+
/** reports the validity of `input` depending on type. */
|
|
26
|
+
export declare function reportValidity(input: WizardInputElement): boolean;
|
|
27
|
+
/** @returns the `value` or `maybeValue` of `input` depending on type. */
|
|
28
|
+
export declare function getValue(input: WizardInputElement): string | null;
|
|
29
|
+
/** @returns the `multiplier` of `input` if available. */
|
|
30
|
+
export declare function getMultiplier(input: WizardInputElement): string | null;
|
|
31
|
+
/** Inputs as `TextField`, `Select` or `Checkbox `used in`wizard-dialog` */
|
|
32
|
+
export type WizardInput = WizardInputTextField | WizardInputSelect | WizardInputCheckbox;
|
|
33
|
+
interface WizardInputBase {
|
|
34
|
+
/** maps attribute key */
|
|
35
|
+
label: string;
|
|
36
|
+
/** maps attribute value */
|
|
37
|
+
maybeValue: string | null;
|
|
38
|
+
/** whether attribute is optional */
|
|
39
|
+
nullable?: boolean;
|
|
40
|
+
/** whether the input shall be disabled */
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
/** helper text */
|
|
43
|
+
helper?: string;
|
|
44
|
+
/** initial focused element in `wizard-dialog` (once per dialog) */
|
|
45
|
+
dialogInitialFocus?: boolean;
|
|
46
|
+
}
|
|
47
|
+
interface WizardInputTextField extends WizardInputBase {
|
|
48
|
+
kind: 'TextField';
|
|
49
|
+
/** wether the input might be empty string */
|
|
50
|
+
required?: boolean;
|
|
51
|
+
/** pattern definition from schema */
|
|
52
|
+
pattern?: string;
|
|
53
|
+
/** minimal characters allowed */
|
|
54
|
+
minLength?: number;
|
|
55
|
+
/** maximal characters allowed */
|
|
56
|
+
maxLength?: number;
|
|
57
|
+
/** message text explaining invalid inputs */
|
|
58
|
+
validationMessage?: string;
|
|
59
|
+
/** suffix definition - overwrites unit multiplier definition */
|
|
60
|
+
suffix?: string;
|
|
61
|
+
/** SI unit for specific suffix definition */
|
|
62
|
+
unit?: string;
|
|
63
|
+
/** in comibination with unit defines specific suffix */
|
|
64
|
+
multiplier?: string | null;
|
|
65
|
+
/** array of multipliers allowed for the input */
|
|
66
|
+
multipliers?: (string | null)[];
|
|
67
|
+
/** used for specific input type e.g. number */
|
|
68
|
+
type?: string;
|
|
69
|
+
/** minimal valid number in combination with type number */
|
|
70
|
+
min?: number;
|
|
71
|
+
/** maximal valid number in combination with type number */
|
|
72
|
+
max?: number;
|
|
73
|
+
/** value displaxed when input is nulled */
|
|
74
|
+
default?: string;
|
|
75
|
+
}
|
|
76
|
+
interface WizardInputSelect extends WizardInputBase {
|
|
77
|
+
kind: 'Select';
|
|
78
|
+
/** selectabled values */
|
|
79
|
+
values: string[];
|
|
80
|
+
/** value displayed with input is nulled */
|
|
81
|
+
default?: string;
|
|
82
|
+
/** message explaining invalid inputs */
|
|
83
|
+
valadationMessage?: string;
|
|
84
|
+
}
|
|
85
|
+
interface WizardInputCheckbox extends WizardInputBase {
|
|
86
|
+
kind: 'Checkbox';
|
|
87
|
+
/** wether checkbox is checked with nulled input */
|
|
88
|
+
default?: boolean;
|
|
89
|
+
}
|
|
90
|
+
/** @returns [[`WizardAction`]]s to dispatch on [[`WizardDialog`]] menu action. */
|
|
91
|
+
export type WizardMenuActor = (wizard: Element) => void;
|
|
92
|
+
/** User interactions rendered in the wizard-dialog menu */
|
|
93
|
+
export interface MenuAction {
|
|
94
|
+
label: string;
|
|
95
|
+
icon?: string;
|
|
96
|
+
action: WizardMenuActor;
|
|
97
|
+
}
|
|
98
|
+
/** Represents a page of a wizard dialog */
|
|
99
|
+
export interface WizardPage {
|
|
100
|
+
title: string;
|
|
101
|
+
content?: (TemplateResult | WizardInput)[];
|
|
102
|
+
primary?: {
|
|
103
|
+
icon: string;
|
|
104
|
+
label: string;
|
|
105
|
+
action: WizardActor;
|
|
106
|
+
auto?: boolean;
|
|
107
|
+
};
|
|
108
|
+
secondary?: {
|
|
109
|
+
icon: string;
|
|
110
|
+
label: string;
|
|
111
|
+
action: WizardActor;
|
|
112
|
+
};
|
|
113
|
+
initial?: boolean;
|
|
114
|
+
element?: Element;
|
|
115
|
+
menuActions?: MenuAction[];
|
|
116
|
+
}
|
|
117
|
+
export type Wizard = WizardPage[];
|
|
118
|
+
export type WizardFactory = () => Wizard;
|
|
119
|
+
/** If `wizard === null`, close the current wizard, else queue `wizard`. */
|
|
120
|
+
export interface WizardDetail {
|
|
121
|
+
wizard: WizardFactory | null;
|
|
122
|
+
subwizard?: boolean;
|
|
123
|
+
}
|
|
124
|
+
export type WizardEvent = CustomEvent<WizardDetail>;
|
|
125
|
+
export declare function newWizardEvent(wizardOrFactory?: Wizard | WizardFactory, eventInitDict?: CustomEventInit<Partial<WizardDetail>>): WizardEvent;
|
|
126
|
+
export declare function newSubWizardEvent(wizardOrFactory?: Wizard | WizardFactory): WizardEvent;
|
|
127
|
+
/** @returns a reference to `element` with segments delimited by '/'. */
|
|
128
|
+
export declare function referencePath(element: Element): string;
|
|
129
|
+
export type SclEdition = '2003' | '2007B' | '2007B4';
|
|
130
|
+
export declare function getSclSchemaVersion(doc: Document): SclEdition;
|
|
131
|
+
/**
|
|
132
|
+
* Extract the 'name' attribute from the given XML element.
|
|
133
|
+
* @param element - The element to extract name from.
|
|
134
|
+
* @returns the name, or undefined if there is no name.
|
|
135
|
+
*/
|
|
136
|
+
export declare function getNameAttribute(element: Element): string | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Extract the 'ldName' attribute from the given XML element.
|
|
139
|
+
* @param element - The element to extract ldName from.
|
|
140
|
+
* @returns the ldName, or undefined if there is no ldName.
|
|
141
|
+
*/
|
|
142
|
+
export declare function getLdNameAttribute(element: Element): string | undefined;
|
|
143
|
+
/**
|
|
144
|
+
* Extract the 'desc' attribute from the given XML element.
|
|
145
|
+
* @param element - The element to extract description from.
|
|
146
|
+
* @returns the name, or undefined if there is no description.
|
|
147
|
+
*/
|
|
148
|
+
export declare function getDescriptionAttribute(element: Element): string | undefined;
|
|
149
|
+
/**
|
|
150
|
+
* Extract the 'pathName' attribute from the given XML element.
|
|
151
|
+
* @param element - The element to extract path name from.
|
|
152
|
+
* @returns the name, or undefined if there is no path name.
|
|
153
|
+
*/
|
|
154
|
+
export declare function getPathNameAttribute(element: Element): string | undefined;
|
|
155
|
+
/**
|
|
156
|
+
* Extract the 'inst' attribute from the given XML element.
|
|
157
|
+
* @param element - The element to extract instance from.
|
|
158
|
+
* @returns the instance, or undefined if there is no instance.
|
|
159
|
+
*/
|
|
160
|
+
export declare function getInstanceAttribute(element: Element): string | undefined;
|
|
161
|
+
export declare function pathParts(identity: string): [string, string];
|
|
162
|
+
type IdentityFunction = (e: Element) => string | number;
|
|
163
|
+
type SelectorFunction = (tagName: SCLTag, identity: string) => string;
|
|
164
|
+
declare const sCLTags: readonly ["SCL", "SubNetwork", "GOOSESecurity", "SMVSecurity", "ConnectivityNode", "SubFunction", "Function", "TapChanger", "SubEquipment", "GeneralEquipment", "PowerTransformer", "TransformerWinding", "ConductingEquipment", "Substation", "VoltageLevel", "Bay", "Process", "Line", "EqSubFunction", "EqFunction", "ConnectedAP", "PhysConn", "SDO", "DO", "DAI", "SDI", "DOI", "Inputs", "RptEnabled", "Server", "ServerAt", "SettingControl", "Communication", "Log", "LDevice", "DataSet", "AccessPoint", "IED", "NeutralPoint", "SampledValueControl", "GSEControl", "LogControl", "ReportControl", "GSE", "SMV", "BDA", "DA", "LNodeType", "DOType", "DAType", "EnumType", "Text", "Private", "Hitem", "AccessControl", "Header", "LNode", "Val", "Voltage", "Services", "Subject", "IssuerName", "MinTime", "MaxTime", "Association", "FCDA", "ClientLN", "IEDName", "ExtRef", "Protocol", "LN0", "LN", "FileHandling", "TimeSyncProt", "CommProt", "SGEdit", "ConfSG", "GetDirectory", "GetDataObjectDefinition", "DataObjectDirectory", "GetDataSetValue", "SetDataSetValue", "DataSetDirectory", "ReadWrite", "TimerActivatedControl", "GetCBValues", "GSEDir", "ConfLdName", "DynAssociation", "SettingGroups", "GSSE", "GOOSE", "ConfReportControl", "SMVsc", "DynDataSet", "ConfDataSet", "ConfLogControl", "ConfSigRef", "ReportSettings", "LogSettings", "GSESettings", "SMVSettings", "ConfLNs", "ClientServices", "SupSubscription", "ValueHandling", "RedProt", "McSecurity", "KDC", "Address", "P", "ProtNs", "EnumVal", "Terminal", "BitRate", "Authentication", "DataTypeTemplates", "History", "OptFields", "SmvOpts", "TrgOps", "SamplesPerSec", "SmpRate", "SecPerSamples"];
|
|
165
|
+
export type SCLTag = (typeof sCLTags)[number];
|
|
166
|
+
export declare const tags: Record<SCLTag, {
|
|
167
|
+
identity: IdentityFunction;
|
|
168
|
+
selector: SelectorFunction;
|
|
169
|
+
parents: SCLTag[];
|
|
170
|
+
children: SCLTag[];
|
|
171
|
+
}>;
|
|
172
|
+
export declare function getReference(parent: Element, tag: SCLTag): Element | null;
|
|
173
|
+
export declare function find(root: XMLDocument | Element | DocumentFragment, tagName: string, identity: string | number): Element | null;
|
|
174
|
+
/** @returns a string uniquely identifying `e` in its document, or NaN if `e`
|
|
175
|
+
* is unidentifiable. */
|
|
176
|
+
export declare function identity(e: Element | null): string | number;
|
|
177
|
+
/** @returns whether `a` and `b` are considered identical by IEC-61850 */
|
|
178
|
+
export declare function isSame(a: Element, b: Element): boolean;
|
|
179
|
+
export declare function isEqual(a: Element, b: Element): boolean;
|
|
180
|
+
/** A directive rendering its argument `rendered` only if `rendered !== {}`. */
|
|
181
|
+
export declare const ifImplemented: (rendered: any) => (part: Part) => void;
|
|
182
|
+
/** Constructor type for defining `LitElement` mixins. */
|
|
183
|
+
export type LitElementConstructor = new (...args: any[]) => LitElement;
|
|
184
|
+
/** The type returned by `MyMixin(...)` is `Mixin<typeof MyMixin>`. */
|
|
185
|
+
export type Mixin<T extends (...args: any[]) => any> = InstanceType<ReturnType<T>>;
|
|
186
|
+
export declare const patterns: {
|
|
187
|
+
string: string;
|
|
188
|
+
normalizedString: string;
|
|
189
|
+
name: string;
|
|
190
|
+
nmToken: string;
|
|
191
|
+
names: string;
|
|
192
|
+
nmTokens: string;
|
|
193
|
+
decimal: string;
|
|
194
|
+
unsigned: string;
|
|
195
|
+
integer: string;
|
|
196
|
+
alphanumericFirstUpperCase: string;
|
|
197
|
+
alphanumericFirstLowerCase: string;
|
|
198
|
+
lnClass: string;
|
|
199
|
+
};
|
|
200
|
+
/** Sorts selected `ListItem`s to the top and disabled ones to the bottom. */
|
|
201
|
+
export declare function compareNames(a: Element | string, b: Element | string): number;
|
|
202
|
+
/** @returns the cartesian product of `arrays` */
|
|
203
|
+
export declare function crossProduct<T>(...arrays: T[][]): T[][];
|
|
204
|
+
/** @returns the depth of `t` if it is an object or array, zero otherwise. */
|
|
205
|
+
export declare function depth(t: Record<string, unknown>, mem?: WeakSet<object>): number;
|
|
206
|
+
export declare function findFCDAs(extRef: Element): Element[];
|
|
207
|
+
export declare function findControlBlocks(extRef: Element): Set<Element>;
|
|
208
|
+
export declare function isPublic(element: Element): boolean;
|
|
209
|
+
/** @returns the version of the SCL project */
|
|
210
|
+
export declare function getVersion(element: Element): string;
|
|
211
|
+
/**
|
|
212
|
+
* @param parent - The LNodes' parent element to be scanned once for `lnInst`
|
|
213
|
+
* values already in use. Be sure to create a new generator every time the
|
|
214
|
+
* children of this element change.
|
|
215
|
+
* @returns a function generating increasing unused `lnInst` values for
|
|
216
|
+
* `lnClass` LNodes within `parent` on subsequent invocations
|
|
217
|
+
*/
|
|
218
|
+
export declare function newLnInstGenerator(parent: Element): (lnClass: string) => string | undefined;
|
|
219
|
+
/**
|
|
220
|
+
* @param lnElements - The LN elements to be scanned for `inst`
|
|
221
|
+
* values already in use.
|
|
222
|
+
* @returns first available inst value for LN or undefined if no inst is available
|
|
223
|
+
*/
|
|
224
|
+
export declare function minAvailableLogicalNodeInstance(lnElements: Element[]): string | undefined;
|
|
225
|
+
declare global {
|
|
226
|
+
interface ElementEventMap {
|
|
227
|
+
['wizard']: WizardEvent;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { SVGTemplateResult, TemplateResult } from 'lit-element';
|
|
2
|
+
export type iconType = 'action' | 'dAIcon' | 'dOIcon' | 'enumIcon' | 'info' | 'warning' | 'error' | 'reset' | 'reportIcon' | 'smvIcon' | 'gooseIcon' | 'lNIcon' | 'logIcon';
|
|
3
|
+
export declare const editIcon: TemplateResult;
|
|
4
|
+
export declare const gooseIcon: SVGTemplateResult;
|
|
5
|
+
export declare const reportIcon: SVGTemplateResult;
|
|
6
|
+
export declare const smvIcon: SVGTemplateResult;
|
|
7
|
+
export declare const logIcon: SVGTemplateResult;
|
|
8
|
+
export declare const controlBlockIcons: Partial<Record<string, SVGTemplateResult>>;
|
|
9
|
+
export declare const inputIcon: SVGTemplateResult;
|
|
10
|
+
export declare const clientIcon: SVGTemplateResult;
|
|
11
|
+
export declare const disconnect: SVGTemplateResult;
|
|
12
|
+
export type iconProperty = {
|
|
13
|
+
width: number;
|
|
14
|
+
height: number;
|
|
15
|
+
};
|
|
16
|
+
export declare const iconProperties: Partial<Record<iconType, iconProperty>>;
|
|
17
|
+
export declare const dataTypeTemplateIcons: Partial<Record<string, SVGTemplateResult>>;
|
|
18
|
+
export declare const iconColors: {
|
|
19
|
+
[key: string]: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function getIcon(type: iconType): TemplateResult;
|
|
22
|
+
export declare function getFilterIcon(type: iconType, state: boolean): TemplateResult;
|
|
23
|
+
export declare const networkConfigIcon: TemplateResult;
|
|
24
|
+
export declare const zeroLineIcon: TemplateResult;
|
|
25
|
+
export declare const voltageLevelIcon: TemplateResult;
|
|
26
|
+
export declare const bayIcon: TemplateResult;
|
|
27
|
+
export declare const disconnectorIcon: TemplateResult;
|
|
28
|
+
export declare const circuitBreakerIcon: TemplateResult;
|
|
29
|
+
export declare const currentTransformerIcon: TemplateResult;
|
|
30
|
+
export declare const voltageTransformerIcon: TemplateResult;
|
|
31
|
+
export declare const earthSwitchIcon: TemplateResult;
|
|
32
|
+
export declare const generalConductingEquipmentIcon: TemplateResult;
|
|
33
|
+
export declare const connectivityNodeIcon: TemplateResult;
|
|
34
|
+
export declare const powerTransformerTwoWindingIcon: TemplateResult;
|
|
35
|
+
export declare const openSCDIcon: TemplateResult;
|
|
36
|
+
export declare const sizableSmvIcon: SVGTemplateResult;
|
|
37
|
+
export declare const sizableGooseIcon: SVGTemplateResult;
|
|
38
|
+
export declare const substationIcon: SVGTemplateResult;
|
|
39
|
+
export declare const lineIcon: SVGTemplateResult;
|
|
40
|
+
export declare const processIcon: SVGTemplateResult;
|
|
41
|
+
export declare const transformerWindingIcon: SVGTemplateResult;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const systemLogicalNode: import("lit-element").SVGTemplateResult;
|
|
2
|
+
export declare const automationLogicalNode: import("lit-element").SVGTemplateResult;
|
|
3
|
+
export declare const controlLogicalNode: import("lit-element").SVGTemplateResult;
|
|
4
|
+
export declare const functionalLogicalNode: import("lit-element").SVGTemplateResult;
|
|
5
|
+
export declare const generalLogicalNode: import("lit-element").SVGTemplateResult;
|
|
6
|
+
export declare const interfacingLogicalNode: import("lit-element").SVGTemplateResult;
|
|
7
|
+
export declare const nonElectricalLogicalNode: import("lit-element").SVGTemplateResult;
|
|
8
|
+
export declare const measurementLogicalNode: import("lit-element").SVGTemplateResult;
|
|
9
|
+
export declare const protectionLogicalNode: import("lit-element").SVGTemplateResult;
|
|
10
|
+
export declare const qualityLogicalNode: import("lit-element").SVGTemplateResult;
|
|
11
|
+
export declare const protectionRelatedLogicalNode: import("lit-element").SVGTemplateResult;
|
|
12
|
+
export declare const supervisionLogicalNode: import("lit-element").SVGTemplateResult;
|
|
13
|
+
export declare const transformerLogicalNode: import("lit-element").SVGTemplateResult;
|
|
14
|
+
export declare const switchgearLogicalNode: import("lit-element").SVGTemplateResult;
|
|
15
|
+
export declare const powerTransformerLogicalNode: import("lit-element").SVGTemplateResult;
|
|
16
|
+
export declare const furtherPowerSystemEquipmentLogicalNode: import("lit-element").SVGTemplateResult;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit-element';
|
|
2
|
+
import '@material/mwc-icon';
|
|
3
|
+
import '@material/mwc-icon-button';
|
|
4
|
+
import '@material/mwc-linear-progress';
|
|
5
|
+
import '@material/mwc-list';
|
|
6
|
+
import '@material/mwc-list/mwc-list-item';
|
|
7
|
+
import '@material/mwc-tab';
|
|
8
|
+
import '@material/mwc-tab-bar';
|
|
9
|
+
import '@material/mwc-top-app-bar-fixed';
|
|
10
|
+
import '@material/mwc-drawer';
|
|
11
|
+
import '@material/mwc-button';
|
|
12
|
+
import '@material/mwc-dialog';
|
|
13
|
+
import '@material/mwc-formfield';
|
|
14
|
+
import '@material/mwc-list/mwc-check-list-item';
|
|
15
|
+
import '@material/mwc-list/mwc-radio-list-item';
|
|
16
|
+
import '@material/mwc-select';
|
|
17
|
+
import '@material/mwc-switch';
|
|
18
|
+
import '@material/mwc-textfield';
|
|
19
|
+
import './addons/Settings.js';
|
|
20
|
+
import './addons/Waiter.js';
|
|
21
|
+
import './addons/Wizards.js';
|
|
22
|
+
import './addons/Editor.js';
|
|
23
|
+
import './addons/History.js';
|
|
24
|
+
import './addons/Layout.js';
|
|
25
|
+
import { ActionDetail } from '@material/mwc-list';
|
|
26
|
+
import { Nsdoc } from './foundation/nsdoc.js';
|
|
27
|
+
import type { PluginSet, Plugin as CorePlugin } from '@openscd/core';
|
|
28
|
+
import { XMLEditor } from '@openscd/core';
|
|
29
|
+
import { MenuPosition, PluginKind, Plugin } from "./plugin.js";
|
|
30
|
+
import { ConfigurePluginEvent } from './plugin.events.js';
|
|
31
|
+
/** The `<open-scd>` custom element is the main entry point of the
|
|
32
|
+
* Open Substation Configuration Designer. */
|
|
33
|
+
export declare class OpenSCD extends LitElement {
|
|
34
|
+
render(): TemplateResult;
|
|
35
|
+
doc: XMLDocument | null;
|
|
36
|
+
/** The name of the current [[`doc`]] */
|
|
37
|
+
docName: string;
|
|
38
|
+
/** The UUID of the current [[`doc`]] */
|
|
39
|
+
docId: string;
|
|
40
|
+
editor: XMLEditor;
|
|
41
|
+
/** Object containing all *.nsdoc files and a function extracting element's label form them*/
|
|
42
|
+
nsdoc: Nsdoc;
|
|
43
|
+
private currentSrc;
|
|
44
|
+
/** The current file's URL. `blob:` URLs are *revoked after parsing*! */
|
|
45
|
+
get src(): string;
|
|
46
|
+
set src(value: string);
|
|
47
|
+
private storedPlugins;
|
|
48
|
+
private editCount;
|
|
49
|
+
private unsubscribers;
|
|
50
|
+
/** Loads and parses an `XMLDocument` after [[`src`]] has changed. */
|
|
51
|
+
private loadDoc;
|
|
52
|
+
/**
|
|
53
|
+
*
|
|
54
|
+
* @deprecated Use `handleConfigurationPluginEvent` instead
|
|
55
|
+
*/
|
|
56
|
+
handleAddExternalPlugin(e: AddExternalPluginEvent): void;
|
|
57
|
+
handleConfigurationPluginEvent(e: ConfigurePluginEvent): void;
|
|
58
|
+
connectedCallback(): void;
|
|
59
|
+
disconnectedCallback(): void;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* @param name
|
|
63
|
+
* @param kind
|
|
64
|
+
* @returns the index of the plugin in the stored plugin list
|
|
65
|
+
*/
|
|
66
|
+
private findPluginIndex;
|
|
67
|
+
private hasPlugin;
|
|
68
|
+
private removePlugin;
|
|
69
|
+
private addPlugin;
|
|
70
|
+
/**
|
|
71
|
+
*
|
|
72
|
+
* @param plugin
|
|
73
|
+
* @throws if the plugin is not found
|
|
74
|
+
*/
|
|
75
|
+
private changePlugin;
|
|
76
|
+
private resetPlugins;
|
|
77
|
+
/**
|
|
78
|
+
* @prop {PluginSet} plugins - Set of plugins that are used by OpenSCD
|
|
79
|
+
*/
|
|
80
|
+
plugins: PluginSet;
|
|
81
|
+
get parsedPlugins(): Plugin[];
|
|
82
|
+
private updateStoredPlugins;
|
|
83
|
+
private storePlugins;
|
|
84
|
+
private getPluginConfigsFromLocalStorage;
|
|
85
|
+
protected get locale(): string;
|
|
86
|
+
get docs(): Record<string, XMLDocument>;
|
|
87
|
+
private setPlugins;
|
|
88
|
+
private loadPlugins;
|
|
89
|
+
private addExternalPlugin;
|
|
90
|
+
protected getBuiltInPlugins(): CorePlugin[];
|
|
91
|
+
private addContent;
|
|
92
|
+
private loadedPlugins;
|
|
93
|
+
private pluginTags;
|
|
94
|
+
private pluginTag;
|
|
95
|
+
}
|
|
96
|
+
declare global {
|
|
97
|
+
interface ElementEventMap {
|
|
98
|
+
'reset-plugins': CustomEvent;
|
|
99
|
+
'add-external-plugin': CustomEvent<AddExternalPluginDetail>;
|
|
100
|
+
'set-plugins': CustomEvent<SetPluginsDetail>;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
export interface MenuItem {
|
|
104
|
+
icon: string;
|
|
105
|
+
name: string;
|
|
106
|
+
src?: string;
|
|
107
|
+
hint?: string;
|
|
108
|
+
actionItem?: boolean;
|
|
109
|
+
action?: (event: CustomEvent<ActionDetail>) => void;
|
|
110
|
+
disabled?: () => boolean;
|
|
111
|
+
content: () => TemplateResult;
|
|
112
|
+
kind: string;
|
|
113
|
+
}
|
|
114
|
+
export interface Validator {
|
|
115
|
+
validate: () => Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
export interface MenuPlugin {
|
|
118
|
+
run: () => Promise<void>;
|
|
119
|
+
}
|
|
120
|
+
export declare function newResetPluginsEvent(): CustomEvent;
|
|
121
|
+
export interface AddExternalPluginDetail {
|
|
122
|
+
plugin: Omit<Plugin, 'content'>;
|
|
123
|
+
}
|
|
124
|
+
export type AddExternalPluginEvent = CustomEvent<AddExternalPluginDetail>;
|
|
125
|
+
export declare function newAddExternalPluginEvent(plugin: Omit<Plugin, 'content'>): AddExternalPluginEvent;
|
|
126
|
+
export interface SetPluginsDetail {
|
|
127
|
+
selectedPlugins: Plugin[];
|
|
128
|
+
}
|
|
129
|
+
export type SetPluginsEvent = CustomEvent<SetPluginsDetail>;
|
|
130
|
+
export declare function newSetPluginsEvent(selectedPlugins: Plugin[]): SetPluginsEvent;
|
|
131
|
+
export declare const pluginIcons: Record<PluginKind | MenuPosition, string>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-element';
|
|
2
|
+
import '@material/mwc-icon-button';
|
|
3
|
+
import '@material/mwc-dialog';
|
|
4
|
+
import './filtered-list.js';
|
|
5
|
+
import { FilteredList } from './filtered-list.js';
|
|
6
|
+
/**
|
|
7
|
+
* A mwc-list with mwc-textfield that filters the list items for given or separated terms
|
|
8
|
+
*/
|
|
9
|
+
export declare class FilterButton extends FilteredList {
|
|
10
|
+
header: TemplateResult | string;
|
|
11
|
+
icon: string;
|
|
12
|
+
disabled: boolean;
|
|
13
|
+
private filterDialog;
|
|
14
|
+
private toggleList;
|
|
15
|
+
private onClosing;
|
|
16
|
+
render(): TemplateResult;
|
|
17
|
+
static styles: import("lit-element").CSSResult;
|
|
18
|
+
}
|
|
19
|
+
export interface SelectedItemsChangedDetail {
|
|
20
|
+
selectedItems: string[];
|
|
21
|
+
}
|
|
22
|
+
export type SelectedItemsChangedEvent = CustomEvent<SelectedItemsChangedDetail>;
|
|
23
|
+
declare global {
|
|
24
|
+
interface ElementEventMap {
|
|
25
|
+
['selected-items-changed']: SelectedItemsChangedEvent;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit-element';
|
|
2
|
+
import { DiffFilter } from './foundation/compare.js';
|
|
3
|
+
export declare class PlainCompareList extends LitElement {
|
|
4
|
+
/**
|
|
5
|
+
* The title of the left list
|
|
6
|
+
*/
|
|
7
|
+
leftHandTitle: string;
|
|
8
|
+
/**
|
|
9
|
+
* The title of the right list
|
|
10
|
+
*/
|
|
11
|
+
rightHandTitle: string;
|
|
12
|
+
/**
|
|
13
|
+
* The left Element that should be compared
|
|
14
|
+
*/
|
|
15
|
+
leftHandObject: Element;
|
|
16
|
+
/**
|
|
17
|
+
* The right element that should be compared against
|
|
18
|
+
*/
|
|
19
|
+
rightHandObject: Element;
|
|
20
|
+
/**
|
|
21
|
+
* Optional filter to ignore differences
|
|
22
|
+
*/
|
|
23
|
+
filterToIgnore?: DiffFilter<Element>;
|
|
24
|
+
/**
|
|
25
|
+
* The subtitle of the left list (optional)
|
|
26
|
+
*/
|
|
27
|
+
leftHandSubtitle: string;
|
|
28
|
+
/**
|
|
29
|
+
* The subtitle of the right list (optional)
|
|
30
|
+
*/
|
|
31
|
+
rightHandSubtitle: string;
|
|
32
|
+
filterMutables: boolean;
|
|
33
|
+
render(): TemplateResult;
|
|
34
|
+
protected renderFilterCheckbox(): TemplateResult;
|
|
35
|
+
static styles: import("lit-element").CSSResult;
|
|
36
|
+
}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-element';
|
|
2
|
+
import { Plugin as CorePlugin } from "@openscd/core";
|
|
3
|
+
export type Plugin = CorePlugin & {
|
|
4
|
+
official?: boolean;
|
|
5
|
+
active: boolean;
|
|
6
|
+
content?: () => TemplateResult;
|
|
7
|
+
};
|
|
8
|
+
export type PluginConfig = PluginConfigNotMenu | PluginConfigMenu;
|
|
9
|
+
export type PluginConfigNotMenu = Omit<Plugin, "position" | "active"> & {
|
|
10
|
+
kind: 'editor' | 'validator';
|
|
11
|
+
};
|
|
12
|
+
export type PluginConfigMenu = Omit<Plugin, "active"> & {
|
|
13
|
+
kind: 'menu';
|
|
14
|
+
position: MenuPosition;
|
|
15
|
+
};
|
|
16
|
+
export type InstalledOfficialPlugin = Plugin & {
|
|
17
|
+
src: string;
|
|
18
|
+
official: true;
|
|
19
|
+
installed: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type PluginKind = 'editor' | 'menu' | 'validator';
|
|
22
|
+
export declare const menuPosition: readonly ["top", "middle", "bottom"];
|
|
23
|
+
export type MenuPosition = (typeof menuPosition)[number];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Plugin, PluginKind } from './plugin.js';
|
|
2
|
+
/**
|
|
3
|
+
* The configure plugin event allows the plugin to request that OpenSCD core add, remove, or reconfigure a plugin.
|
|
4
|
+
*/
|
|
5
|
+
export type ConfigurePluginDetail = {
|
|
6
|
+
name: string;
|
|
7
|
+
kind: PluginKind;
|
|
8
|
+
config: Plugin | null;
|
|
9
|
+
};
|
|
10
|
+
export type ConfigurePluginEvent = CustomEvent<ConfigurePluginDetail>;
|
|
11
|
+
/**
|
|
12
|
+
* The combination of name and kind uniquely identifies the plugin to be configured.
|
|
13
|
+
* If config is null, the plugin is removed. Otherwise, the plugin is added or reconfigured.
|
|
14
|
+
*/
|
|
15
|
+
export declare function newConfigurePluginEvent(name: string, kind: PluginKind, config: Plugin | null): ConfigurePluginEvent;
|