@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,12 @@
|
|
|
1
|
+
import { Strings } from 'lit-translate';
|
|
2
|
+
import { en } from './en.js';
|
|
3
|
+
export interface TranslationObject {
|
|
4
|
+
[key: string]: string | TranslationObject;
|
|
5
|
+
}
|
|
6
|
+
export interface Languages {
|
|
7
|
+
de: TranslationObject;
|
|
8
|
+
en: TranslationObject;
|
|
9
|
+
}
|
|
10
|
+
export declare const languages: Languages;
|
|
11
|
+
export type Translations = typeof en;
|
|
12
|
+
export declare function loader(lang: string): Promise<Strings>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit-element';
|
|
2
|
+
import '@material/mwc-formfield';
|
|
3
|
+
import '@material/mwc-switch';
|
|
4
|
+
import '@material/mwc-checkbox';
|
|
5
|
+
import { Checkbox } from '@material/mwc-checkbox';
|
|
6
|
+
import { Switch } from '@material/mwc-switch';
|
|
7
|
+
/** A potentially `nullable` labelled checkbox. */
|
|
8
|
+
export declare class WizardCheckbox extends LitElement {
|
|
9
|
+
label: string;
|
|
10
|
+
/** Parenthetical information rendered after the label: `label (helper)` */
|
|
11
|
+
helper: string;
|
|
12
|
+
/** Whether [[`maybeValue`]] may be `null` */
|
|
13
|
+
nullable: boolean;
|
|
14
|
+
/** The default `checked` state while [[`maybeValue`]] is `null`. */
|
|
15
|
+
defaultChecked: boolean;
|
|
16
|
+
/** Is `"true"` when checked, `"false"` un-checked, `null` if [[`nullable`]]. */
|
|
17
|
+
get maybeValue(): string | null;
|
|
18
|
+
set maybeValue(check: string | null);
|
|
19
|
+
/** Disables component including null switch */
|
|
20
|
+
disabled: boolean;
|
|
21
|
+
private isNull;
|
|
22
|
+
private get null();
|
|
23
|
+
private set null(value);
|
|
24
|
+
private initChecked;
|
|
25
|
+
get checked(): boolean;
|
|
26
|
+
set checked(value: boolean);
|
|
27
|
+
private deactivateCheckbox;
|
|
28
|
+
get formfieldLabel(): string;
|
|
29
|
+
nullSwitch?: Switch;
|
|
30
|
+
checkbox?: Checkbox;
|
|
31
|
+
private nulled;
|
|
32
|
+
private enable;
|
|
33
|
+
private disable;
|
|
34
|
+
firstUpdated(): void;
|
|
35
|
+
renderSwitch(): TemplateResult;
|
|
36
|
+
render(): TemplateResult;
|
|
37
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit-element';
|
|
2
|
+
import '@material/mwc-button';
|
|
3
|
+
import '@material/mwc-dialog';
|
|
4
|
+
import '@material/mwc-icon-button';
|
|
5
|
+
import '@material/mwc-icon-button-toggle';
|
|
6
|
+
import '@material/mwc-menu';
|
|
7
|
+
import { Dialog } from '@material/mwc-dialog';
|
|
8
|
+
import { IconButton } from '@material/mwc-icon-button';
|
|
9
|
+
import { Menu } from '@material/mwc-menu';
|
|
10
|
+
import 'ace-custom-element';
|
|
11
|
+
import './wizard-checkbox.js';
|
|
12
|
+
import './wizard-textfield.js';
|
|
13
|
+
import './wizard-select.js';
|
|
14
|
+
import { Wizard, WizardInputElement, WizardPage, WizardActor, WizardMenuActor } from './foundation.js';
|
|
15
|
+
/** A wizard style dialog consisting of several pages commiting some
|
|
16
|
+
* [[`EditorAction`]] on completion and aborting on dismissal. */
|
|
17
|
+
export declare class WizardDialog extends LitElement {
|
|
18
|
+
/** The [[`Wizard`]] implemented by this dialog. */
|
|
19
|
+
wizard: Wizard;
|
|
20
|
+
/** Index of the currently active [[`WizardPage`]] */
|
|
21
|
+
pageIndex: number;
|
|
22
|
+
dialogs: NodeListOf<Dialog>;
|
|
23
|
+
inputs: NodeListOf<WizardInputElement>;
|
|
24
|
+
actionsMenu: Menu;
|
|
25
|
+
menuButton: IconButton;
|
|
26
|
+
/** The `Dialog` showing the active [[`WizardPage`]]. */
|
|
27
|
+
get dialog(): Dialog | undefined;
|
|
28
|
+
get code(): boolean;
|
|
29
|
+
/** Checks the inputs of all [[`WizardPage`]]s for validity. */
|
|
30
|
+
checkValidity(): boolean;
|
|
31
|
+
private get firstInvalidPage();
|
|
32
|
+
prev(): void;
|
|
33
|
+
next(): Promise<void>;
|
|
34
|
+
/** Commits `action` if all inputs are valid, reports validity otherwise. */
|
|
35
|
+
act(action?: WizardActor, primary?: boolean): Promise<boolean>;
|
|
36
|
+
/** Triggers menu action callback */
|
|
37
|
+
menuAct(action?: WizardMenuActor): Promise<void>;
|
|
38
|
+
private onClosed;
|
|
39
|
+
constructor();
|
|
40
|
+
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
|
41
|
+
renderMenu(page: WizardPage): TemplateResult;
|
|
42
|
+
renderPage(page: WizardPage, index: number): TemplateResult;
|
|
43
|
+
render(): TemplateResult;
|
|
44
|
+
static styles: import("lit-element").CSSResult;
|
|
45
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-element';
|
|
2
|
+
import '@material/mwc-switch';
|
|
3
|
+
import { Switch } from '@material/mwc-switch';
|
|
4
|
+
import { Select } from '@material/mwc-select';
|
|
5
|
+
/** A potentially `nullable` `Select`.
|
|
6
|
+
*
|
|
7
|
+
* NB: Use `maybeValue: string | null` instead of `value` if `nullable`!*/
|
|
8
|
+
export declare class WizardSelect extends Select {
|
|
9
|
+
/** Whether [[`maybeValue`]] may be `null` */
|
|
10
|
+
nullable: boolean;
|
|
11
|
+
private isNull;
|
|
12
|
+
private get null();
|
|
13
|
+
private set null(value);
|
|
14
|
+
/** Replacement for `value`, can only be `null` if [[`nullable`]]. */
|
|
15
|
+
get maybeValue(): string | null;
|
|
16
|
+
set maybeValue(value: string | null);
|
|
17
|
+
/** The default `value` displayed if [[`maybeValue`]] is `null`. */
|
|
18
|
+
defaultValue: string;
|
|
19
|
+
/** Additional values that cause validation to fail. */
|
|
20
|
+
reservedValues: string[];
|
|
21
|
+
private disabledSwitch;
|
|
22
|
+
nullSwitch?: Switch;
|
|
23
|
+
private nulled;
|
|
24
|
+
private enable;
|
|
25
|
+
private disable;
|
|
26
|
+
firstUpdated(): Promise<void>;
|
|
27
|
+
checkValidity(): boolean;
|
|
28
|
+
constructor();
|
|
29
|
+
renderSwitch(): TemplateResult;
|
|
30
|
+
render(): TemplateResult;
|
|
31
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { TemplateResult } from 'lit-element';
|
|
2
|
+
import '@material/mwc-icon-button';
|
|
3
|
+
import '@material/mwc-list/mwc-list-item';
|
|
4
|
+
import '@material/mwc-menu';
|
|
5
|
+
import '@material/mwc-switch';
|
|
6
|
+
import { IconButton } from '@material/mwc-icon-button';
|
|
7
|
+
import { Menu } from '@material/mwc-menu';
|
|
8
|
+
import { Switch } from '@material/mwc-switch';
|
|
9
|
+
import { TextField } from '@material/mwc-textfield';
|
|
10
|
+
/** A potentially `nullable` `TextField` that allows for selection of an SI
|
|
11
|
+
* `multiplier` if an SI `unit` is given.
|
|
12
|
+
*
|
|
13
|
+
* NB: Use `maybeValue: string | null` instead of `value` if `nullable`!*/
|
|
14
|
+
export declare class WizardTextField extends TextField {
|
|
15
|
+
/** Whether [[`maybeValue`]] may be `null` */
|
|
16
|
+
nullable: boolean;
|
|
17
|
+
/** Selectable SI multipliers for a non-empty [[`unit`]]. */
|
|
18
|
+
multipliers: (string | null)[];
|
|
19
|
+
private multiplierIndex;
|
|
20
|
+
get multiplier(): string | null;
|
|
21
|
+
set multiplier(value: string | null);
|
|
22
|
+
/** SI Unit, must be non-empty to allow for selecting a [[`multiplier`]].
|
|
23
|
+
* Overrides `suffix`. */
|
|
24
|
+
unit: string;
|
|
25
|
+
private isNull;
|
|
26
|
+
private get null();
|
|
27
|
+
private set null(value);
|
|
28
|
+
/** Replacement for `value`, can only be `null` if [[`nullable`]]. */
|
|
29
|
+
get maybeValue(): string | null;
|
|
30
|
+
set maybeValue(value: string | null);
|
|
31
|
+
/** The default `value` displayed if [[`maybeValue`]] is `null`. */
|
|
32
|
+
defaultValue: string;
|
|
33
|
+
/** Additional values that cause validation to fail. */
|
|
34
|
+
reservedValues: string[];
|
|
35
|
+
private disabledSwitch;
|
|
36
|
+
nullSwitch?: Switch;
|
|
37
|
+
multiplierMenu?: Menu;
|
|
38
|
+
multiplierButton?: IconButton;
|
|
39
|
+
private nulled;
|
|
40
|
+
private selectMultiplier;
|
|
41
|
+
private enable;
|
|
42
|
+
private disable;
|
|
43
|
+
firstUpdated(): Promise<void>;
|
|
44
|
+
checkValidity(): boolean;
|
|
45
|
+
constructor();
|
|
46
|
+
renderUnitSelector(): TemplateResult;
|
|
47
|
+
renderMulplierList(): TemplateResult;
|
|
48
|
+
renderSwitch(): TemplateResult;
|
|
49
|
+
render(): TemplateResult;
|
|
50
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import '@material/mwc-icon';
|
|
2
|
+
import '@material/mwc-list';
|
|
3
|
+
import '@material/mwc-list/mwc-check-list-item';
|
|
4
|
+
import '@material/mwc-list/mwc-list-item';
|
|
5
|
+
import { Wizard } from './foundation.js';
|
|
6
|
+
interface MergeOptions {
|
|
7
|
+
title?: string;
|
|
8
|
+
selected?: (diff: Diff<Element | string>) => boolean;
|
|
9
|
+
disabled?: (diff: Diff<Element | string>) => boolean;
|
|
10
|
+
auto?: (sink: Element, source: Element) => boolean;
|
|
11
|
+
}
|
|
12
|
+
export type Diff<T> = {
|
|
13
|
+
ours: T;
|
|
14
|
+
theirs: null;
|
|
15
|
+
} | {
|
|
16
|
+
ours: null;
|
|
17
|
+
theirs: T;
|
|
18
|
+
} | {
|
|
19
|
+
ours: T;
|
|
20
|
+
theirs: T;
|
|
21
|
+
};
|
|
22
|
+
export declare function mergeWizard(sink: Element, source: Element, options?: MergeOptions): Wizard;
|
|
23
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@compas-oscd/open-scd",
|
|
3
|
-
"version": "0.34.
|
|
3
|
+
"version": "0.34.3",
|
|
4
4
|
"repository": "https://github.com/openscd/open-scd.git",
|
|
5
5
|
"directory": "packages/openscd",
|
|
6
6
|
"description": "A bottom-up substation configuration designer for projects described using SCL `IEC 61850-6` Edition 2 or greater.",
|
|
@@ -26,78 +26,98 @@
|
|
|
26
26
|
"types": "./dist/foundation.d.ts",
|
|
27
27
|
"default": "./dist/foundation.js"
|
|
28
28
|
},
|
|
29
|
-
"./
|
|
29
|
+
"./foundation.js": {
|
|
30
30
|
"types": "./dist/foundation.d.ts",
|
|
31
31
|
"default": "./dist/foundation.js"
|
|
32
32
|
},
|
|
33
|
-
"./
|
|
34
|
-
"types": "./dist/foundation.d.ts",
|
|
35
|
-
"default": "./dist/foundation.js"
|
|
36
|
-
},
|
|
37
|
-
"./src/foundation/nsdoc.js": {
|
|
33
|
+
"./foundation/nsdoc.js": {
|
|
38
34
|
"types": "./dist/foundation/nsdoc.d.ts",
|
|
39
35
|
"default": "./dist/foundation/nsdoc.js"
|
|
40
36
|
},
|
|
41
|
-
"./
|
|
37
|
+
"./plain-compare-list.js": {
|
|
42
38
|
"types": "./dist/plain-compare-list.d.ts",
|
|
43
39
|
"default": "./dist/plain-compare-list.js"
|
|
44
40
|
},
|
|
45
|
-
"./
|
|
41
|
+
"./filtered-list.js": {
|
|
46
42
|
"types": "./dist/filtered-list.d.ts",
|
|
47
43
|
"default": "./dist/filtered-list.js"
|
|
48
44
|
},
|
|
49
|
-
"./
|
|
45
|
+
"./action-pane.js": {
|
|
50
46
|
"types": "./dist/action-pane.d.ts",
|
|
51
47
|
"default": "./dist/action-pane.js"
|
|
52
48
|
},
|
|
53
|
-
"./
|
|
49
|
+
"./action-icon.js": {
|
|
54
50
|
"types": "./dist/action-icon.d.ts",
|
|
55
51
|
"default": "./dist/action-icon.js"
|
|
56
52
|
},
|
|
57
|
-
"./
|
|
53
|
+
"./addons/History.js": {
|
|
58
54
|
"types": "./dist/addons/History.d.ts",
|
|
59
55
|
"default": "./dist/addons/History.js"
|
|
60
56
|
},
|
|
61
|
-
"./
|
|
57
|
+
"./addons/Layout.js": {
|
|
62
58
|
"types": "./dist/addons/Layout.d.ts",
|
|
63
59
|
"default": "./dist/addons/Layout.js"
|
|
64
60
|
},
|
|
65
|
-
"./
|
|
61
|
+
"./addons/Waiter.js": {
|
|
66
62
|
"types": "./dist/addons/Waiter.d.ts",
|
|
67
63
|
"default": "./dist/addons/Waiter.js"
|
|
68
64
|
},
|
|
69
|
-
"./
|
|
65
|
+
"./addons/Settings.js": {
|
|
70
66
|
"types": "./dist/addons/Settings.d.ts",
|
|
71
67
|
"default": "./dist/addons/Settings.js"
|
|
72
68
|
},
|
|
73
|
-
"./
|
|
69
|
+
"./addons/Wizards.js": {
|
|
74
70
|
"types": "./dist/addons/Wizards.d.ts",
|
|
75
71
|
"default": "./dist/addons/Wizards.js"
|
|
76
72
|
},
|
|
77
|
-
"./
|
|
73
|
+
"./plugin.js": {
|
|
78
74
|
"types": "./dist/plugin.d.ts",
|
|
79
75
|
"default": "./dist/plugin.js"
|
|
80
76
|
},
|
|
81
|
-
"./
|
|
77
|
+
"./plugin.events.js": {
|
|
82
78
|
"types": "./dist/plugin.events.d.ts",
|
|
83
79
|
"default": "./dist/plugin.events.js"
|
|
84
80
|
},
|
|
85
|
-
"./
|
|
81
|
+
"./plugin-tag.js": {
|
|
86
82
|
"types": "./dist/plugin-tag.d.ts",
|
|
87
83
|
"default": "./dist/plugin-tag.js"
|
|
88
84
|
},
|
|
89
|
-
"./
|
|
85
|
+
"./wizard-dialog.js": {
|
|
90
86
|
"types": "./dist/wizard-dialog.d.ts",
|
|
91
87
|
"default": "./dist/wizard-dialog.js"
|
|
92
88
|
},
|
|
93
|
-
"./
|
|
89
|
+
"./wizard-textfield.js": {
|
|
94
90
|
"types": "./dist/wizard-textfield.d.ts",
|
|
95
91
|
"default": "./dist/wizard-textfield.js"
|
|
96
92
|
},
|
|
97
|
-
"./
|
|
93
|
+
"./wizards.js": {
|
|
94
|
+
"types": "./dist/wizards.d.ts",
|
|
95
|
+
"default": "./dist/wizards.js"
|
|
96
|
+
},
|
|
97
|
+
"./schemas.js": {
|
|
98
|
+
"types": "./dist/schemas.d.ts",
|
|
99
|
+
"default": "./dist/schemas.js"
|
|
100
|
+
},
|
|
101
|
+
"./oscd-filter-button.js": {
|
|
102
|
+
"types": "./dist/oscd-filter-button.d.ts",
|
|
103
|
+
"default": "./dist/oscd-filter-button.js"
|
|
104
|
+
},
|
|
105
|
+
"./WizardDivider.js": {
|
|
106
|
+
"types": "./dist/WizardDivider.d.ts",
|
|
107
|
+
"default": "./dist/WizardDivider.js"
|
|
108
|
+
},
|
|
109
|
+
"./Wizarding.js": {
|
|
98
110
|
"types": "./dist/Wizarding.d.ts",
|
|
99
111
|
"default": "./dist/Wizarding.js"
|
|
100
112
|
},
|
|
113
|
+
"./translations/de.js": {
|
|
114
|
+
"types": "./dist/translations/de.d.ts",
|
|
115
|
+
"default": "./dist/translations/de.js"
|
|
116
|
+
},
|
|
117
|
+
"./translations/en.js": {
|
|
118
|
+
"types": "./dist/translations/en.d.ts",
|
|
119
|
+
"default": "./dist/translations/en.js"
|
|
120
|
+
},
|
|
101
121
|
"./test/mock-editor-logger.js": {
|
|
102
122
|
"types": "./dist/test/mock-editor-logger.d.ts",
|
|
103
123
|
"default": "./dist/test/mock-editor-logger.js"
|
package/dist/core/api/api.js
DELETED
package/dist/core/api/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../core/api/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,MAAM,OAAO,OAAO;IAGlB,YAAY,SAAiB;QAC3B,IAAI,CAAC,WAAW,GAAG,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;IACnD,CAAC;CACF","sourcesContent":["import { PluginStateApi } from './plugin-state-api.js';\n\nexport class OscdApi {\n public pluginState: PluginStateApi;\n\n constructor(pluginTag: string) {\n this.pluginState = new PluginStateApi(pluginTag);\n }\n}\n"]}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export class Subject {
|
|
2
|
-
constructor() {
|
|
3
|
-
this.subscribers = [];
|
|
4
|
-
}
|
|
5
|
-
next(value) {
|
|
6
|
-
this.subscribers.forEach(s => s(value));
|
|
7
|
-
}
|
|
8
|
-
subscribe(subscriber) {
|
|
9
|
-
this.subscribers.push(subscriber);
|
|
10
|
-
return () => {
|
|
11
|
-
this.unsubscribe(subscriber);
|
|
12
|
-
return subscriber;
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
unsubscribe(subscriber) {
|
|
16
|
-
const indexToRemove = this.subscribers.findIndex(s => s === subscriber);
|
|
17
|
-
if (indexToRemove > -1) {
|
|
18
|
-
this.subscribers.splice(indexToRemove, 1);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=subject.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"subject.js","sourceRoot":"","sources":["../../../../../core/api/editor/subject.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,OAAO;IAApB;QACU,gBAAW,GAAoB,EAAE,CAAC;IAqB5C,CAAC;IAnBQ,IAAI,CAAC,KAAQ;QAClB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,CAAC;IAEM,SAAS,CAAC,UAAyB;QACxC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAElC,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;YAC7B,OAAO,UAAU,CAAC;QACpB,CAAC,CAAA;IACH,CAAC;IAEM,WAAW,CAAC,UAAyB;QAC1C,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,UAAU,CAAC,CAAC;QACxE,IAAI,aAAa,GAAG,CAAC,CAAC,EAAE;YACtB,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC;SAC3C;IACH,CAAC;CACF","sourcesContent":["export type Subscriber<T> = (value: T) => void;\nexport type Unsubscriber<T> = () => Subscriber<T>;\n\nexport class Subject<T> {\n private subscribers: Subscriber<T>[] = [];\n\n public next(value: T): void {\n this.subscribers.forEach(s => s(value));\n }\n\n public subscribe(subscriber: Subscriber<T>): Unsubscriber<T> {\n this.subscribers.push(subscriber);\n\n return () => {\n this.unsubscribe(subscriber);\n return subscriber;\n }\n }\n\n public unsubscribe(subscriber: Subscriber<T>): void {\n const indexToRemove = this.subscribers.findIndex(s => s === subscriber);\n if (indexToRemove > -1) {\n this.subscribers.splice(indexToRemove, 1);\n }\n }\n}\n"]}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Subject } from './subject.js';
|
|
2
|
-
import { handleEditV2 } from '../../foundation.js';
|
|
3
|
-
export class XMLEditor {
|
|
4
|
-
constructor() {
|
|
5
|
-
this.past = [];
|
|
6
|
-
this.future = [];
|
|
7
|
-
this.commitSubject = new Subject();
|
|
8
|
-
this.undoSubject = new Subject();
|
|
9
|
-
this.redoSubject = new Subject();
|
|
10
|
-
}
|
|
11
|
-
get canUndo() {
|
|
12
|
-
return this.past.length > 0;
|
|
13
|
-
}
|
|
14
|
-
get canRedo() {
|
|
15
|
-
return this.future.length > 0;
|
|
16
|
-
}
|
|
17
|
-
reset() {
|
|
18
|
-
this.past = [];
|
|
19
|
-
this.future = [];
|
|
20
|
-
}
|
|
21
|
-
commit(change, { title, squash } = {}) {
|
|
22
|
-
const commit = squash && this.past.length
|
|
23
|
-
? this.past[this.past.length - 1]
|
|
24
|
-
: { undo: [], redo: [], time: Date.now() };
|
|
25
|
-
// TODO: Fix type once issue is fixed https://github.com/openscd/oscd-api/issues/57
|
|
26
|
-
const undo = handleEditV2(change);
|
|
27
|
-
// typed as per https://github.com/microsoft/TypeScript/issues/49280#issuecomment-1144181818 recommendation:
|
|
28
|
-
commit.undo.unshift(...[undo].flat(Infinity));
|
|
29
|
-
commit.redo.push(...[change].flat(Infinity));
|
|
30
|
-
if (title)
|
|
31
|
-
commit.title = title;
|
|
32
|
-
if (squash && this.past.length)
|
|
33
|
-
this.past.pop();
|
|
34
|
-
this.past.push(commit);
|
|
35
|
-
this.future = [];
|
|
36
|
-
this.commitSubject.next(commit);
|
|
37
|
-
return commit;
|
|
38
|
-
}
|
|
39
|
-
;
|
|
40
|
-
undo() {
|
|
41
|
-
const commit = this.past.pop();
|
|
42
|
-
if (!commit)
|
|
43
|
-
return;
|
|
44
|
-
// TODO: Fix type once issue is fixed https://github.com/openscd/oscd-api/issues/57
|
|
45
|
-
handleEditV2(commit.undo);
|
|
46
|
-
this.future.unshift(commit);
|
|
47
|
-
this.undoSubject.next(commit);
|
|
48
|
-
return commit;
|
|
49
|
-
}
|
|
50
|
-
;
|
|
51
|
-
redo() {
|
|
52
|
-
const commit = this.future.shift();
|
|
53
|
-
if (!commit)
|
|
54
|
-
return;
|
|
55
|
-
// TODO: Fix type once issue is fixed https://github.com/openscd/oscd-api/issues/57
|
|
56
|
-
handleEditV2(commit.redo);
|
|
57
|
-
this.past.push(commit);
|
|
58
|
-
this.redoSubject.next(commit);
|
|
59
|
-
return commit;
|
|
60
|
-
}
|
|
61
|
-
;
|
|
62
|
-
subscribe(txCallback) {
|
|
63
|
-
return this.commitSubject.subscribe(txCallback);
|
|
64
|
-
}
|
|
65
|
-
;
|
|
66
|
-
subscribeUndo(txCallback) {
|
|
67
|
-
return this.undoSubject.subscribe(txCallback);
|
|
68
|
-
}
|
|
69
|
-
subscribeRedo(txCallback) {
|
|
70
|
-
return this.redoSubject.subscribe(txCallback);
|
|
71
|
-
}
|
|
72
|
-
subscribeUndoRedo(txCallback) {
|
|
73
|
-
const unsubscribeUndo = this.subscribeUndo(txCallback);
|
|
74
|
-
const unsubscribeRedo = this.subscribeRedo(txCallback);
|
|
75
|
-
return () => {
|
|
76
|
-
unsubscribeUndo();
|
|
77
|
-
unsubscribeRedo();
|
|
78
|
-
return txCallback;
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
//# sourceMappingURL=xml-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"xml-editor.js","sourceRoot":"","sources":["../../../../../core/api/editor/xml-editor.ts"],"names":[],"mappings":"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","sourcesContent":["import { Transactor, TransactedCallback, Commit, CommitOptions } from '@openscd/oscd-api/dist/Transactor.js';\nimport { EditV2 } from '@openscd/oscd-api/dist/editv2.js';\n\nimport { Subject } from './subject.js';\nimport { handleEditV2 } from '../../foundation.js';\n\nexport interface OscdCommit<C> extends Commit<C> {\n time: number;\n}\n\nexport class XMLEditor implements Transactor<EditV2> {\n public past: OscdCommit<EditV2>[] = [];\n public future: OscdCommit<EditV2>[] = [];\n\n private commitSubject = new Subject<OscdCommit<EditV2>>();\n private undoSubject = new Subject<OscdCommit<EditV2>>();\n private redoSubject = new Subject<OscdCommit<EditV2>>();\n\n get canUndo(): boolean {\n return this.past.length > 0;\n }\n\n get canRedo(): boolean {\n return this.future.length > 0;\n }\n\n reset(): void {\n this.past = [];\n this.future = [];\n }\n\n commit(change: EditV2, { title, squash }: CommitOptions = {}): OscdCommit<EditV2> {\n const commit: OscdCommit<EditV2> =\n squash && this.past.length\n ? this.past[this.past.length - 1]\n : { undo: [], redo: [], time: Date.now() };\n // TODO: Fix type once issue is fixed https://github.com/openscd/oscd-api/issues/57\n const undo = handleEditV2(change as any);\n // typed as per https://github.com/microsoft/TypeScript/issues/49280#issuecomment-1144181818 recommendation:\n commit.undo.unshift(...[undo].flat(Infinity as 1));\n commit.redo.push(...[change].flat(Infinity as 1));\n if (title) commit.title = title;\n if (squash && this.past.length) this.past.pop();\n this.past.push(commit);\n this.future = [];\n this.commitSubject.next(commit);\n return commit;\n };\n\n undo(): OscdCommit<EditV2> | undefined {\n const commit = this.past.pop();\n if (!commit) return;\n // TODO: Fix type once issue is fixed https://github.com/openscd/oscd-api/issues/57\n handleEditV2(commit.undo as any);\n this.future.unshift(commit);\n this.undoSubject.next(commit);\n return commit;\n };\n\n redo(): OscdCommit<EditV2> | undefined {\n const commit = this.future.shift();\n if (!commit) return;\n // TODO: Fix type once issue is fixed https://github.com/openscd/oscd-api/issues/57\n handleEditV2(commit.redo as any);\n this.past.push(commit);\n this.redoSubject.next(commit);\n return commit;\n };\n\n subscribe(txCallback: TransactedCallback<EditV2>): () => TransactedCallback<EditV2> {\n return this.commitSubject.subscribe(txCallback) as () => TransactedCallback<EditV2>;\n };\n\n subscribeUndo(txCallback: TransactedCallback<EditV2>): () => TransactedCallback<EditV2> {\n return this.undoSubject.subscribe(txCallback) as () => TransactedCallback<EditV2>;\n }\n\n subscribeRedo(txCallback: TransactedCallback<EditV2>): () => TransactedCallback<EditV2> {\n return this.redoSubject.subscribe(txCallback) as () => TransactedCallback<EditV2>;\n }\n\n subscribeUndoRedo(txCallback: TransactedCallback<EditV2>): () => TransactedCallback<EditV2> {\n const unsubscribeUndo = this.subscribeUndo(txCallback);\n const unsubscribeRedo = this.subscribeRedo(txCallback);\n\n return () => {\n unsubscribeUndo();\n unsubscribeRedo();\n return txCallback;\n }\n }\n}\n"]}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
export class PluginStateApi {
|
|
2
|
-
constructor(tag) {
|
|
3
|
-
this.pluginTag = tag;
|
|
4
|
-
}
|
|
5
|
-
setState(state) {
|
|
6
|
-
this.setPluginState(state);
|
|
7
|
-
}
|
|
8
|
-
getState() {
|
|
9
|
-
return this.getPluginState();
|
|
10
|
-
}
|
|
11
|
-
updateState(partialState) {
|
|
12
|
-
const pluginState = this.getPluginState();
|
|
13
|
-
const patchedState = {
|
|
14
|
-
...pluginState,
|
|
15
|
-
...partialState
|
|
16
|
-
};
|
|
17
|
-
this.setPluginState(patchedState);
|
|
18
|
-
}
|
|
19
|
-
setPluginState(state) {
|
|
20
|
-
PluginStateApi.state[this.pluginTag] = state;
|
|
21
|
-
}
|
|
22
|
-
getPluginState() {
|
|
23
|
-
return PluginStateApi.state[this.pluginTag] ?? null;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
PluginStateApi.state = {};
|
|
27
|
-
//# sourceMappingURL=plugin-state-api.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-state-api.js","sourceRoot":"","sources":["../../../../core/api/plugin-state-api.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,cAAc;IAIzB,YAAY,GAAW;QACrB,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC;IACvB,CAAC;IAEM,QAAQ,CAAC,KAAyB;QACvC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,cAAc,EAAE,CAAC;IAC/B,CAAC;IAEM,WAAW,CAAC,YAAkC;QACnD,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1C,MAAM,YAAY,GAAG;YACnB,GAAG,WAAW;YACd,GAAG,YAAY;SAChB,CAAC;QACF,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;IACpC,CAAC;IAEO,cAAc,CAAC,KAAyB;QAC9C,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,KAAK,CAAC;IAC/C,CAAC;IAEO,cAAc;QACpB,OAAO,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC;IACtD,CAAC;;AA9Bc,oBAAK,GAA0C,EAAE,CAAC","sourcesContent":["type PluginState = {\n [key: string]: unknown\n}\n\nexport class PluginStateApi {\n private static state: { [tag: string]: PluginState | null } = {};\n private pluginTag: string;\n\n constructor(tag: string) {\n this.pluginTag = tag;\n }\n\n public setState(state: PluginState | null): void {\n this.setPluginState(state);\n }\n\n public getState(): PluginState | null {\n return this.getPluginState();\n }\n\n public updateState(partialState: Partial<PluginState>): void {\n const pluginState = this.getPluginState();\n const patchedState = {\n ...pluginState,\n ...partialState\n };\n this.setPluginState(patchedState);\n }\n\n private setPluginState(state: PluginState | null): void {\n PluginStateApi.state[this.pluginTag] = state;\n }\n\n private getPluginState(): PluginState | null {\n return PluginStateApi.state[this.pluginTag] ?? null;\n }\n}\n"]}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Hashes `str` using the cyrb64 variant of
|
|
3
|
-
* https://github.com/bryc/code/blob/master/jshash/experimental/cyrb53.js
|
|
4
|
-
* @returns digest - a rather insecure hash, very quickly
|
|
5
|
-
*/
|
|
6
|
-
export function cyrb64(str) {
|
|
7
|
-
/* eslint-disable no-bitwise */
|
|
8
|
-
let h1 = 0xdeadbeef;
|
|
9
|
-
let h2 = 0x41c6ce57;
|
|
10
|
-
/* eslint-disable-next-line no-plusplus */
|
|
11
|
-
for (let i = 0, ch; i < str.length; i++) {
|
|
12
|
-
ch = str.charCodeAt(i);
|
|
13
|
-
h1 = Math.imul(h1 ^ ch, 2654435761);
|
|
14
|
-
h2 = Math.imul(h2 ^ ch, 1597334677);
|
|
15
|
-
}
|
|
16
|
-
h1 =
|
|
17
|
-
Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^
|
|
18
|
-
Math.imul(h2 ^ (h2 >>> 13), 3266489909);
|
|
19
|
-
h2 =
|
|
20
|
-
Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^
|
|
21
|
-
Math.imul(h1 ^ (h1 >>> 13), 3266489909);
|
|
22
|
-
return ((h2 >>> 0).toString(16).padStart(8, '0') +
|
|
23
|
-
(h1 >>> 0).toString(16).padStart(8, '0'));
|
|
24
|
-
/* eslint-enable no-bitwise */
|
|
25
|
-
}
|
|
26
|
-
//# sourceMappingURL=cyrb64.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cyrb64.js","sourceRoot":"","sources":["../../../../core/foundation/cyrb64.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,+BAA+B;IAC/B,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,IAAI,EAAE,GAAG,UAAU,CAAC;IACpB,0CAA0C;IAC1C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACvC,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACvB,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;QACpC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,EAAE,UAAU,CAAC,CAAC;KACrC;IACD,EAAE;QACA,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC;YACvC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;IAC1C,EAAE;QACA,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC;YACvC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,UAAU,CAAC,CAAC;IAC1C,OAAO,CACL,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;QACxC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CACzC,CAAC;IACF,8BAA8B;AAChC,CAAC","sourcesContent":["/**\n * Hashes `str` using the cyrb64 variant of\n * https://github.com/bryc/code/blob/master/jshash/experimental/cyrb53.js\n * @returns digest - a rather insecure hash, very quickly\n */\nexport function cyrb64(str: string): string {\n /* eslint-disable no-bitwise */\n let h1 = 0xdeadbeef;\n let h2 = 0x41c6ce57;\n /* eslint-disable-next-line no-plusplus */\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i);\n h1 = Math.imul(h1 ^ ch, 2654435761);\n h2 = Math.imul(h2 ^ ch, 1597334677);\n }\n h1 =\n Math.imul(h1 ^ (h1 >>> 16), 2246822507) ^\n Math.imul(h2 ^ (h2 >>> 13), 3266489909);\n h2 =\n Math.imul(h2 ^ (h2 >>> 16), 2246822507) ^\n Math.imul(h1 ^ (h1 >>> 13), 3266489909);\n return (\n (h2 >>> 0).toString(16).padStart(8, '0') +\n (h1 >>> 0).toString(16).padStart(8, '0')\n );\n /* eslint-enable no-bitwise */\n}\n"]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated Use the new edit event V2 API instead.
|
|
3
|
-
*/
|
|
4
|
-
export function isComplex(edit) {
|
|
5
|
-
return edit instanceof Array;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use the new edit event V2 API instead.
|
|
9
|
-
*/
|
|
10
|
-
export function isInsert(edit) {
|
|
11
|
-
return edit.parent !== undefined;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* @deprecated Use the new edit event V2 API instead.
|
|
15
|
-
*/
|
|
16
|
-
export function isNamespaced(value) {
|
|
17
|
-
return value !== null && typeof value !== 'string';
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @deprecated Use the new edit event V2 API instead.
|
|
21
|
-
*/
|
|
22
|
-
export function isUpdate(edit) {
|
|
23
|
-
return edit.element !== undefined;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Use the new edit event V2 API instead.
|
|
27
|
-
*/
|
|
28
|
-
export function isRemove(edit) {
|
|
29
|
-
return (edit.parent === undefined && edit.node !== undefined);
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* @deprecated Use the new edit event V2 API instead.
|
|
33
|
-
*/
|
|
34
|
-
export function newEditEvent(edit, initiator = 'user') {
|
|
35
|
-
return new CustomEvent('oscd-edit', {
|
|
36
|
-
composed: true,
|
|
37
|
-
bubbles: true,
|
|
38
|
-
detail: {
|
|
39
|
-
edit: edit,
|
|
40
|
-
initiator: initiator,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=edit-event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-event.js","sourceRoot":"","sources":["../../../../../core/foundation/deprecated/edit-event.ts"],"names":[],"mappings":"AA6CA;;GAEG;AACH,MAAM,UAAU,SAAS,CAAC,IAAU;IAClC,OAAO,IAAI,YAAY,KAAK,CAAC;AAC/B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAU;IACjC,OAAQ,IAAe,CAAC,MAAM,KAAK,SAAS,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,KAAqB;IAErB,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACrD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAU;IACjC,OAAQ,IAAe,CAAC,OAAO,KAAK,SAAS,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAU;IACjC,OAAO,CACJ,IAAe,CAAC,MAAM,KAAK,SAAS,IAAK,IAAe,CAAC,IAAI,KAAK,SAAS,CAC7E,CAAC;AACJ,CAAC;AAeD;;GAEG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAO,EACP,YAAuB,MAAM;IAE7B,OAAO,IAAI,WAAW,CAAkB,WAAW,EAAE;QACnD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,SAAS;SACrB;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type Initiator = 'user' | 'system' | 'undo' | 'redo' | string;\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type Insert = {\n parent: Node;\n node: Node;\n reference: Node | null;\n};\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type NamespacedAttributeValue = {\n value: string | null;\n namespaceURI: string | null;\n};\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type AttributeValue = string | null | NamespacedAttributeValue;\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type Update = {\n element: Element;\n attributes: Partial<Record<string, AttributeValue>>;\n};\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type Remove = {\n node: Node;\n};\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type Edit = Insert | Update | Remove | Edit[];\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport function isComplex(edit: Edit): edit is Edit[] {\n return edit instanceof Array;\n}\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport function isInsert(edit: Edit): edit is Insert {\n return (edit as Insert).parent !== undefined;\n}\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport function isNamespaced(\n value: AttributeValue\n): value is NamespacedAttributeValue {\n return value !== null && typeof value !== 'string';\n}\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport function isUpdate(edit: Edit): edit is Update {\n return (edit as Update).element !== undefined;\n}\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport function isRemove(edit: Edit): edit is Remove {\n return (\n (edit as Insert).parent === undefined && (edit as Remove).node !== undefined\n );\n}\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport interface EditEventDetail<E extends Edit = Edit> {\n edit: E;\n initiator: Initiator;\n}\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport type EditEvent = CustomEvent<EditEventDetail>;\n\n/**\n * @deprecated Use the new edit event V2 API instead.\n */\nexport function newEditEvent<E extends Edit>(\n edit: E,\n initiator: Initiator = 'user'\n): EditEvent {\n return new CustomEvent<EditEventDetail>('oscd-edit', {\n composed: true,\n bubbles: true,\n detail: {\n edit: edit,\n initiator: initiator,\n },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['oscd-edit']: EditEvent;\n }\n}\n"]}
|