@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
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
export function isCreate(action) {
|
|
2
|
-
return (action.old === undefined &&
|
|
3
|
-
action.new?.parent !== undefined &&
|
|
4
|
-
action.new?.element !== undefined);
|
|
5
|
-
}
|
|
6
|
-
export function isDelete(action) {
|
|
7
|
-
return (action.old?.parent !== undefined &&
|
|
8
|
-
action.old?.element !== undefined &&
|
|
9
|
-
action.new === undefined);
|
|
10
|
-
}
|
|
11
|
-
export function isMove(action) {
|
|
12
|
-
return (action.old?.parent !== undefined &&
|
|
13
|
-
action.old?.element !== undefined &&
|
|
14
|
-
action.new?.parent !== undefined &&
|
|
15
|
-
action.new?.element == undefined);
|
|
16
|
-
}
|
|
17
|
-
export function isReplace(action) {
|
|
18
|
-
return (action.old?.parent === undefined &&
|
|
19
|
-
action.old?.element !== undefined &&
|
|
20
|
-
action.new?.parent === undefined &&
|
|
21
|
-
action.new?.element !== undefined);
|
|
22
|
-
}
|
|
23
|
-
export function isUpdate(action) {
|
|
24
|
-
return (action.old === undefined &&
|
|
25
|
-
action.new === undefined &&
|
|
26
|
-
action.element !== undefined &&
|
|
27
|
-
action.newAttributes !== undefined &&
|
|
28
|
-
action.oldAttributes !== undefined);
|
|
29
|
-
}
|
|
30
|
-
export function isSimple(action) {
|
|
31
|
-
return !(action.actions instanceof Array);
|
|
32
|
-
}
|
|
33
|
-
//** return `Update` action for `element` adding `oldAttributes` */
|
|
34
|
-
export function createUpdateAction(element, newAttributes) {
|
|
35
|
-
const oldAttributes = {};
|
|
36
|
-
Array.from(element.attributes).forEach(attr => {
|
|
37
|
-
oldAttributes[attr.name] = attr.value;
|
|
38
|
-
});
|
|
39
|
-
return { element, oldAttributes, newAttributes };
|
|
40
|
-
}
|
|
41
|
-
/** Throws an error bearing `message`, never returning. */
|
|
42
|
-
export function unreachable(message) {
|
|
43
|
-
throw new Error(message);
|
|
44
|
-
}
|
|
45
|
-
/** @returns an [[`EditorAction`]] with opposite effect of `action`. */
|
|
46
|
-
export function invert(action) {
|
|
47
|
-
if (!isSimple(action)) {
|
|
48
|
-
const inverse = {
|
|
49
|
-
title: action.title,
|
|
50
|
-
derived: action.derived,
|
|
51
|
-
actions: [],
|
|
52
|
-
};
|
|
53
|
-
action.actions.forEach(element => inverse.actions.unshift(invert(element)));
|
|
54
|
-
return inverse;
|
|
55
|
-
}
|
|
56
|
-
const metaData = {
|
|
57
|
-
derived: action.derived,
|
|
58
|
-
checkValidity: action.checkValidity,
|
|
59
|
-
};
|
|
60
|
-
if (isCreate(action))
|
|
61
|
-
return { old: action.new, ...metaData };
|
|
62
|
-
else if (isDelete(action))
|
|
63
|
-
return { new: action.old, ...metaData };
|
|
64
|
-
else if (isMove(action))
|
|
65
|
-
return {
|
|
66
|
-
old: {
|
|
67
|
-
parent: action.new.parent,
|
|
68
|
-
element: action.old.element,
|
|
69
|
-
reference: action.new.reference,
|
|
70
|
-
},
|
|
71
|
-
new: { parent: action.old.parent, reference: action.old.reference },
|
|
72
|
-
...metaData,
|
|
73
|
-
};
|
|
74
|
-
else if (isReplace(action))
|
|
75
|
-
return { new: action.old, old: action.new, ...metaData };
|
|
76
|
-
else if (isUpdate(action))
|
|
77
|
-
return {
|
|
78
|
-
element: action.element,
|
|
79
|
-
oldAttributes: action.newAttributes,
|
|
80
|
-
newAttributes: action.oldAttributes,
|
|
81
|
-
...metaData,
|
|
82
|
-
};
|
|
83
|
-
else
|
|
84
|
-
return unreachable('Unknown EditorAction type in invert.');
|
|
85
|
-
}
|
|
86
|
-
export function newActionEvent(action, initiator = 'user', eventInitDict) {
|
|
87
|
-
return new CustomEvent('editor-action', {
|
|
88
|
-
bubbles: true,
|
|
89
|
-
composed: true,
|
|
90
|
-
...eventInitDict,
|
|
91
|
-
detail: { action, initiator, ...eventInitDict?.detail },
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"editor.js","sourceRoot":"","sources":["../../../../../core/foundation/deprecated/editor.ts"],"names":[],"mappings":"AA8CA,MAAM,UAAU,QAAQ,CAAC,MAAoB;IAC3C,OAAO,CACJ,MAAkB,CAAC,GAAG,KAAK,SAAS;QACpC,MAAiB,CAAC,GAAG,EAAE,MAAM,KAAK,SAAS;QAC3C,MAAiB,CAAC,GAAG,EAAE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AAE;gBACH,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM;gBACzB,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO;gBAC3B,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS;aAChC;YACD,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE;YACnE,GAAG,QAAQ;SACZ,CAAC;SACC,IAAI,SAAS,CAAC,MAAM,CAAC;QACxB,OAAO,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,QAAQ,EAAE,CAAC;SACtD,IAAI,QAAQ,CAAC,MAAM,CAAC;QACvB,OAAO;YACL,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,GAAG,QAAQ;SACZ,CAAC;;QACC,OAAO,WAAW,CAAC,sCAAsC,CAAC,CAAC;AAClE,CAAC;AAWD,MAAM,UAAU,cAAc,CAC5B,MAAS,EACT,YAAuB,MAAM,EAC7B,aAA+D;IAE/D,OAAO,IAAI,WAAW,CAAwB,eAAe,EAAE;QAC7D,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,aAAa;QAChB,MAAM,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,aAAa,EAAE,MAAM,EAAE;KACxD,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Initiator } from './edit-event.js';\n\n/** Inserts `new.element` to `new.parent` before `new.reference`. */\nexport interface Create {\n new: { parent: Node; element: Node; reference?: Node | null };\n derived?: boolean;\n checkValidity?: () => boolean;\n}\n/** Removes `old.element` from `old.parent` before `old.reference`. */\nexport interface Delete {\n old: { parent: Node; element: Node; reference?: Node | null };\n derived?: boolean;\n checkValidity?: () => boolean;\n}\n/** Reparents of `old.element` to `new.parent` before `new.reference`. */\nexport interface Move {\n old: { parent: Element; element: Element; reference?: Node | null };\n new: { parent: Element; reference?: Node | null };\n derived?: boolean;\n checkValidity?: () => boolean;\n}\n/** Replaces `old.element` with `new.element`, keeping element children. */\nexport interface Replace {\n old: { element: Element };\n new: { element: Element };\n derived?: boolean;\n checkValidity?: () => boolean;\n}\n/** Swaps `element`s `oldAttributes` with `newAttributes` */\nexport interface Update {\n element: Element;\n oldAttributes: Record<string, string | null>;\n newAttributes: Record<string, string | null>;\n derived?: boolean;\n checkValidity?: () => boolean;\n}\n\nexport type SimpleAction = Update | Create | Replace | Delete | Move;\nexport type ComplexAction = {\n actions: SimpleAction[];\n title: string;\n derived?: boolean;\n};\n/** Represents an intended or committed change to some `Element`. */\nexport type EditorAction = SimpleAction | ComplexAction;\n\nexport function isCreate(action: EditorAction): action is Create {\n return (\n (action as Replace).old === undefined &&\n (action as Create).new?.parent !== undefined &&\n (action as Create).new?.element !== undefined\n );\n}\nexport function isDelete(action: EditorAction): action is Delete {\n return (\n (action as Delete).old?.parent !== undefined &&\n (action as Delete).old?.element !== undefined &&\n (action as Replace).new === undefined\n );\n}\nexport function isMove(action: EditorAction): action is Move {\n return (\n (action as Move).old?.parent !== undefined &&\n (action as Move).old?.element !== undefined &&\n (action as Move).new?.parent !== undefined &&\n (action as Replace).new?.element == undefined\n );\n}\nexport function isReplace(action: EditorAction): action is Replace {\n return (\n (action as Move).old?.parent === undefined &&\n (action as Replace).old?.element !== undefined &&\n (action as Move).new?.parent === undefined &&\n (action as Replace).new?.element !== undefined\n );\n}\nexport function isUpdate(action: EditorAction): action is Update {\n return (\n (action as Replace).old === undefined &&\n (action as Replace).new === undefined &&\n (action as Update).element !== undefined &&\n (action as Update).newAttributes !== undefined &&\n (action as Update).oldAttributes !== undefined\n );\n}\nexport function isSimple(action: EditorAction): action is SimpleAction {\n return !((<ComplexAction>action).actions instanceof Array);\n}\n\n//** return `Update` action for `element` adding `oldAttributes` */\nexport function createUpdateAction(\n element: Element,\n newAttributes: Record<string, string | null>\n): Update {\n const oldAttributes: Record<string, string | null> = {};\n Array.from(element.attributes).forEach(attr => {\n oldAttributes[attr.name] = attr.value;\n });\n\n return { element, oldAttributes, newAttributes };\n}\n\n/** Throws an error bearing `message`, never returning. */\nexport function unreachable(message: string): never {\n throw new Error(message);\n}\n\n/** @returns an [[`EditorAction`]] with opposite effect of `action`. */\nexport function invert(action: EditorAction): EditorAction {\n if (!isSimple(action)) {\n const inverse: ComplexAction = {\n title: action.title,\n derived: action.derived,\n actions: [],\n };\n action.actions.forEach(element =>\n inverse.actions.unshift(<SimpleAction>invert(element))\n );\n return inverse;\n }\n\n const metaData = {\n derived: action.derived,\n checkValidity: action.checkValidity,\n };\n if (isCreate(action)) return { old: action.new, ...metaData };\n else if (isDelete(action)) return { new: action.old, ...metaData };\n else if (isMove(action))\n return {\n old: {\n parent: action.new.parent,\n element: action.old.element,\n reference: action.new.reference,\n },\n new: { parent: action.old.parent, reference: action.old.reference },\n ...metaData,\n };\n else if (isReplace(action))\n return { new: action.old, old: action.new, ...metaData };\n else if (isUpdate(action))\n return {\n element: action.element,\n oldAttributes: action.newAttributes,\n newAttributes: action.oldAttributes,\n ...metaData,\n };\n else return unreachable('Unknown EditorAction type in invert.');\n}\n\n/** Represents some intended modification of a `Document` being edited. */\nexport interface EditorActionDetail<T extends EditorAction> {\n action: T;\n initiator?: Initiator;\n}\nexport type EditorActionEvent<T extends EditorAction> = CustomEvent<\n EditorActionDetail<T>\n>;\n\nexport function newActionEvent<T extends EditorAction>(\n action: T,\n initiator: Initiator = 'user',\n eventInitDict?: CustomEventInit<Partial<EditorActionDetail<T>>>\n): EditorActionEvent<T> {\n return new CustomEvent<EditorActionDetail<T>>('editor-action', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: { action, initiator, ...eventInitDict?.detail },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['editor-action']: EditorActionEvent<EditorAction>;\n }\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export function newLogEvent(detail, eventInitDict) {
|
|
2
|
-
return new CustomEvent('log', {
|
|
3
|
-
bubbles: true,
|
|
4
|
-
composed: true,
|
|
5
|
-
...eventInitDict,
|
|
6
|
-
detail: { ...detail, ...eventInitDict?.detail },
|
|
7
|
-
});
|
|
8
|
-
}
|
|
9
|
-
export function newIssueEvent(detail, eventInitDict) {
|
|
10
|
-
return new CustomEvent('issue', {
|
|
11
|
-
bubbles: true,
|
|
12
|
-
composed: true,
|
|
13
|
-
...eventInitDict,
|
|
14
|
-
detail: { ...detail, ...eventInitDict?.detail },
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=history.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../../../core/foundation/deprecated/history.ts"],"names":[],"mappings":"AAgDA,MAAM,UAAU,WAAW,CACzB,MAAiB,EACjB,aAA0C;IAE1C,OAAO,IAAI,WAAW,CAAY,KAAK,EAAE;QACvC,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,aAAa;QAChB,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE,MAAM,EAAE;KAChD,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,aAAa,CAC3B,MAAmB,EACnB,aAA4C;IAE5C,OAAO,IAAI,WAAW,CAAc,OAAO,EAAE;QAC3C,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,aAAa;QAChB,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,aAAa,EAAE,MAAM,EAAE;KAChD,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { EditV2 } from '../edit.js';\n\ntype InfoEntryKind = 'info' | 'warning' | 'error';\n\nexport type LogEntryType = 'info' | 'warning' | 'error' | 'action' | 'reset';\n\n/** The basic information contained in each [[`LogEntry`]]. */\nexport interface LogDetailBase {\n title: string;\n message?: string;\n}\n/** The [[`LogEntry`]] for a committed [[`EditorAction`]]. */\nexport interface CommitDetail extends LogDetailBase {\n kind: 'action';\n redo: EditV2;\n undo: EditV2;\n squash?: boolean;\n}\n/** A [[`LogEntry`]] for notifying the user. */\nexport interface InfoDetail extends LogDetailBase {\n kind: InfoEntryKind;\n cause?: LogEntry;\n}\n\nexport interface ResetDetail {\n kind: 'reset';\n}\n\nexport type LogDetail = InfoDetail | CommitDetail | ResetDetail;\nexport type LogEvent = CustomEvent<LogDetail>;\n\nexport interface IssueDetail extends LogDetailBase {\n validatorId: string;\n element?: Element;\n}\nexport type IssueEvent = CustomEvent<IssueDetail>;\n\n/** [[`LogEntry`]]s are timestamped upon being committed to the `history`. */\ninterface Timestamped {\n time: Date | null;\n}\n\nexport type CommitEntry = Timestamped & CommitDetail;\nexport type InfoEntry = Timestamped & InfoDetail;\n\nexport type LogEntry = InfoEntry | CommitEntry;\n\n\nexport function newLogEvent(\n detail: LogDetail,\n eventInitDict?: CustomEventInit<LogDetail>\n): LogEvent {\n return new CustomEvent<LogDetail>('log', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: { ...detail, ...eventInitDict?.detail },\n });\n}\n\nexport function newIssueEvent(\n detail: IssueDetail,\n eventInitDict?: CustomEventInit<IssueDetail>\n): IssueEvent {\n return new CustomEvent<IssueDetail>('issue', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: { ...detail, ...eventInitDict?.detail },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['log']: LogEvent;\n ['issue']: IssueEvent;\n }\n }\n "]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-event.js","sourceRoot":"","sources":["../../../../../core/foundation/deprecated/open-event.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,eAAe,CAC7B,GAAgB,EAChB,OAAe,EACf,aAAuD;IAEvD,OAAO,IAAI,WAAW,CAAgB,UAAU,EAAE;QAChD,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,aAAa;QAChB,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,MAAM,EAAE;KACnD,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** Represents a document to be opened. */\nexport interface OpenDocDetail {\n doc: XMLDocument;\n docName: string;\n docId?: string;\n}\nexport type OpenDocEvent = CustomEvent<OpenDocDetail>;\nexport function newOpenDocEvent(\n doc: XMLDocument,\n docName: string,\n eventInitDict?: CustomEventInit<Partial<OpenDocDetail>>\n): OpenDocEvent {\n return new CustomEvent<OpenDocDetail>('open-doc', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: { doc, docName, ...eventInitDict?.detail },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['open-doc']: OpenDocEvent;\n }\n }"]}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export function newLoadNsdocEvent(nsdoc, filename) {
|
|
2
|
-
return new CustomEvent('load-nsdoc', {
|
|
3
|
-
bubbles: true,
|
|
4
|
-
composed: true,
|
|
5
|
-
detail: { nsdoc, filename },
|
|
6
|
-
});
|
|
7
|
-
}
|
|
8
|
-
export function newSettingsUIEvent(show, eventInitDict) {
|
|
9
|
-
return new CustomEvent('oscd-settings', {
|
|
10
|
-
bubbles: true,
|
|
11
|
-
composed: true,
|
|
12
|
-
...eventInitDict,
|
|
13
|
-
detail: {
|
|
14
|
-
show,
|
|
15
|
-
...eventInitDict?.detail,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=settings.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../../../core/foundation/deprecated/settings.ts"],"names":[],"mappings":"AAgCA,MAAM,UAAU,iBAAiB,CAC/B,KAAa,EACb,QAAgB;IAEhB,OAAO,IAAI,WAAW,CAAkB,YAAY,EAAE;QACpD,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;KAC5B,CAAC,CAAC;AACL,CAAC;AAQD,MAAM,UAAU,kBAAkB,CAChC,IAAa,EACb,aAA0D;IAE1D,OAAO,IAAI,WAAW,CAAmB,eAAe,EAAE;QACxD,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,aAAa;QAChB,MAAM,EAAE;YACN,IAAI;YACJ,GAAG,aAAa,EAAE,MAAM;SACzB;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["export type Language = 'en' | 'de';\n\nexport type Settings = {\n language: Language;\n theme: 'light' | 'dark';\n mode: 'safe' | 'pro';\n showieds: 'on' | 'off';\n 'IEC 61850-7-2': string | undefined;\n 'IEC 61850-7-3': string | undefined;\n 'IEC 61850-7-4': string | undefined;\n 'IEC 61850-8-1': string | undefined;\n};\n\nexport type NsdVersion = {\n version: string | undefined;\n revision: string | undefined;\n release: string | undefined;\n};\n\nexport type NsdVersions = {\n 'IEC 61850-7-2': NsdVersion;\n 'IEC 61850-7-3': NsdVersion;\n 'IEC 61850-7-4': NsdVersion;\n 'IEC 61850-8-1': NsdVersion;\n};\n\n/** Represents a document to be opened. */\nexport interface LoadNsdocDetail {\n nsdoc: string;\n filename: string;\n}\nexport type LoadNsdocEvent = CustomEvent<LoadNsdocDetail>;\nexport function newLoadNsdocEvent(\n nsdoc: string,\n filename: string\n): LoadNsdocEvent {\n return new CustomEvent<LoadNsdocDetail>('load-nsdoc', {\n bubbles: true,\n composed: true,\n detail: { nsdoc, filename },\n });\n}\n\nexport interface SettingsUIDetail {\n show: boolean;\n}\n\nexport type SettingsUIEvent = CustomEvent<SettingsUIDetail>;\n\nexport function newSettingsUIEvent(\n show: boolean,\n eventInitDict?: CustomEventInit<Partial<SettingsUIDetail>>\n): SettingsUIEvent {\n return new CustomEvent<SettingsUIDetail>('oscd-settings', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: {\n show,\n ...eventInitDict?.detail,\n },\n });\n}\n\n\ndeclare global {\n interface ElementEventMap {\n ['oscd-settings']: SettingsUIEvent;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validation.js","sourceRoot":"","sources":["../../../../../core/foundation/deprecated/validation.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,gBAAgB,CAC9B,aAAqC;IAErC,OAAO,IAAI,WAAW,CAAO,UAAU,EAAE;QACvC,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,aAAa;KACjB,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** Represents a request for validation. */\nexport type ValidateEvent = CustomEvent<void>;\nexport function newValidateEvent(\n eventInitDict?: CustomEventInit<void>\n): ValidateEvent {\n return new CustomEvent<void>('validate', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n });\n}\n\n\ndeclare global {\n interface ElementEventMap {\n ['validate']: ValidateEvent;\n }\n }\n "]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated
|
|
3
|
-
*/
|
|
4
|
-
export function newPendingStateEvent(promise, eventInitDict) {
|
|
5
|
-
return new CustomEvent('pending-state', {
|
|
6
|
-
bubbles: true,
|
|
7
|
-
composed: true,
|
|
8
|
-
...eventInitDict,
|
|
9
|
-
detail: { promise, ...eventInitDict?.detail },
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=waiter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"waiter.js","sourceRoot":"","sources":["../../../../../core/foundation/deprecated/waiter.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAClC,OAAsB,EACtB,aAA4D;IAE5D,OAAO,IAAI,WAAW,CAAqB,eAAe,EAAE;QAC1D,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,GAAG,aAAa;QAChB,MAAM,EAAE,EAAE,OAAO,EAAE,GAAG,aAAa,EAAE,MAAM,EAAE;KAC9C,CAAC,CAAC;AACL,CAAC","sourcesContent":["/** Represents some work pending completion, upon which `promise` resolves. */\nexport interface PendingStateDetail {\n promise: Promise<void>;\n}\nexport type PendingStateEvent = CustomEvent<PendingStateDetail>;\n\n/**\n * @deprecated\n */\nexport function newPendingStateEvent(\n promise: Promise<void>,\n eventInitDict?: CustomEventInit<Partial<PendingStateDetail>>\n): PendingStateEvent {\n return new CustomEvent<PendingStateDetail>('pending-state', {\n bubbles: true,\n composed: true,\n ...eventInitDict,\n detail: { promise, ...eventInitDict?.detail },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['pending-state']: PendingStateEvent;\n }\n}\n"]}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export function newEditCompletedEvent(edit, initiator = 'user') {
|
|
2
|
-
return new CustomEvent('oscd-edit-completed', {
|
|
3
|
-
bubbles: true,
|
|
4
|
-
composed: true,
|
|
5
|
-
detail: {
|
|
6
|
-
edit: edit,
|
|
7
|
-
initiator: initiator,
|
|
8
|
-
},
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
//# sourceMappingURL=edit-completed-event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-completed-event.js","sourceRoot":"","sources":["../../../../core/foundation/edit-completed-event.ts"],"names":[],"mappings":"AAYA,MAAM,UAAU,qBAAqB,CACnC,IAAyB,EACzB,YAAuB,MAAM;IAE7B,OAAO,IAAI,WAAW,CAAsB,qBAAqB,EAAE;QACjE,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE;YACN,IAAI,EAAE,IAAI;YACV,SAAS,EAAE,SAAS;SACrB;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { Edit, Initiator } from './deprecated/edit-event.js';\n\nimport { EditorAction } from './deprecated/editor.js';\n\nexport type EditCompletedDetail = {\n edit: Edit | EditorAction;\n initiator: Initiator;\n};\n\n/** Represents the intent to open `doc` with filename `docName`. */\nexport type EditCompletedEvent = CustomEvent<EditCompletedDetail>;\n\nexport function newEditCompletedEvent(\n edit: Edit | EditorAction,\n initiator: Initiator = 'user'\n): EditCompletedEvent {\n return new CustomEvent<EditCompletedDetail>('oscd-edit-completed', {\n bubbles: true,\n composed: true,\n detail: {\n edit: edit,\n initiator: initiator,\n },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['oscd-edit-completed']: EditCompletedEvent;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit-event.js","sourceRoot":"","sources":["../../../../core/foundation/edit-event.ts"],"names":[],"mappings":"AAmBA,MAAM,UAAU,cAAc,CAC5B,IAAO,EACP,OAA4B;IAE5B,OAAO,IAAI,WAAW,CAAkB,cAAc,EAAE;QACtD,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,EAAE,GAAG,OAAO,EAAE,IAAI,EAAE;KAC7B,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { EditV2 } from './edit.js';\n\nexport type EditDetailV2<E extends EditV2 = EditV2> = EditEventOptionsV2 & {\n edit: E;\n};\n\nexport type EditEventV2<E extends EditV2 = EditV2> = CustomEvent<\n EditDetailV2<E>\n>;\n\ntype BaseEditEventOptionsV2 = {\n title?: string;\n squash?: boolean;\n}\n\nexport type EditEventOptionsV2 = BaseEditEventOptionsV2 & {\n createHistoryEntry?: boolean;\n};\n\nexport function newEditEventV2<E extends EditV2>(\n edit: E,\n options?: EditEventOptionsV2\n): EditEventV2<E> {\n return new CustomEvent<EditDetailV2<E>>('oscd-edit-v2', {\n composed: true,\n bubbles: true,\n detail: { ...options, edit },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['oscd-edit-v2']: EditEventV2;\n }\n}\n"]}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
export function isComplexV2(edit) {
|
|
2
|
-
return edit instanceof Array;
|
|
3
|
-
}
|
|
4
|
-
export function isSetTextContentV2(edit) {
|
|
5
|
-
return (edit.element !== undefined &&
|
|
6
|
-
edit.textContent !== undefined);
|
|
7
|
-
}
|
|
8
|
-
export function isRemoveV2(edit) {
|
|
9
|
-
return (edit.parent === undefined && edit.node !== undefined);
|
|
10
|
-
}
|
|
11
|
-
export function isSetAttributesV2(edit) {
|
|
12
|
-
return (edit.element !== undefined &&
|
|
13
|
-
edit.attributes !== undefined &&
|
|
14
|
-
edit.attributesNS !== undefined);
|
|
15
|
-
}
|
|
16
|
-
export function isInsertV2(edit) {
|
|
17
|
-
return (edit.parent !== undefined &&
|
|
18
|
-
edit.node !== undefined &&
|
|
19
|
-
edit.reference !== undefined);
|
|
20
|
-
}
|
|
21
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
-
export function isEditV2(edit) {
|
|
23
|
-
if (isComplexV2(edit)) {
|
|
24
|
-
return !edit.some((e) => !isEditV2(e));
|
|
25
|
-
}
|
|
26
|
-
return (isSetAttributesV2(edit) ||
|
|
27
|
-
isSetTextContentV2(edit) ||
|
|
28
|
-
isInsertV2(edit) ||
|
|
29
|
-
isRemoveV2(edit));
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=edit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"edit.js","sourceRoot":"","sources":["../../../../core/foundation/edit.ts"],"names":[],"mappings":"AAiCA,MAAM,UAAU,WAAW,CAAC,IAAY;IACtC,OAAO,IAAI,YAAY,KAAK,CAAC;AAC/B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY;IAC7C,OAAO,CACJ,IAAyB,CAAC,OAAO,KAAK,SAAS;QAC/C,IAAyB,CAAC,WAAW,KAAK,SAAS,CACrD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,CACJ,IAAiB,CAAC,MAAM,KAAK,SAAS,IAAK,IAAiB,CAAC,IAAI,KAAK,SAAS,CACjF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,CACJ,IAAwB,CAAC,OAAO,KAAK,SAAS;QAC9C,IAAwB,CAAC,UAAU,KAAK,SAAS;QACjD,IAAwB,CAAC,YAAY,KAAK,SAAS,CACrD,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,IAAY;IACrC,OAAO,CACJ,IAAiB,CAAC,MAAM,KAAK,SAAS;QACtC,IAAiB,CAAC,IAAI,KAAK,SAAS;QACpC,IAAiB,CAAC,SAAS,KAAK,SAAS,CAC3C,CAAC;AACJ,CAAC;AAED,8DAA8D;AAC9D,MAAM,UAAU,QAAQ,CAAC,IAAS;IAChC,IAAI,WAAW,CAAC,IAAI,CAAC,EAAE;QACrB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KACxC;IAED,OAAO,CACL,iBAAiB,CAAC,IAAI,CAAC;QACvB,kBAAkB,CAAC,IAAI,CAAC;QACxB,UAAU,CAAC,IAAI,CAAC;QAChB,UAAU,CAAC,IAAI,CAAC,CACjB,CAAC;AACJ,CAAC","sourcesContent":["/** Intent to `parent.insertBefore(node, reference)` */\nexport type InsertV2 = {\n parent: Node;\n node: Node;\n reference: Node | null;\n};\n\n/** Intent to remove a `node` from its `ownerDocument` */\nexport type RemoveV2 = {\n node: Node;\n};\n\n/** Intent to set the `textContent` of `element` */\nexport type SetTextContentV2 = {\n element: Element;\n textContent: string;\n};\n\n/** Intent to set or remove (if `null`) `attributes`(-`NS`) on `element` */\nexport type SetAttributesV2 = {\n element: Element;\n attributes: Partial<Record<string, string | null>>;\n attributesNS: Partial<Record<string, Partial<Record<string, string | null>>>>;\n};\n\n/** Intent to change some XMLDocuments */\nexport type EditV2 =\n | InsertV2\n | SetAttributesV2\n | SetTextContentV2\n | RemoveV2\n | EditV2[];\n\nexport function isComplexV2(edit: EditV2): edit is EditV2[] {\n return edit instanceof Array;\n}\n\nexport function isSetTextContentV2(edit: EditV2): edit is SetTextContentV2 {\n return (\n (edit as SetTextContentV2).element !== undefined &&\n (edit as SetTextContentV2).textContent !== undefined\n );\n}\n\nexport function isRemoveV2(edit: EditV2): edit is RemoveV2 {\n return (\n (edit as InsertV2).parent === undefined && (edit as RemoveV2).node !== undefined\n );\n}\n\nexport function isSetAttributesV2(edit: EditV2): edit is SetAttributesV2 {\n return (\n (edit as SetAttributesV2).element !== undefined &&\n (edit as SetAttributesV2).attributes !== undefined &&\n (edit as SetAttributesV2).attributesNS !== undefined\n );\n}\n\nexport function isInsertV2(edit: EditV2): edit is InsertV2 {\n return (\n (edit as InsertV2).parent !== undefined &&\n (edit as InsertV2).node !== undefined &&\n (edit as InsertV2).reference !== undefined\n );\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function isEditV2(edit: any): edit is EditV2 {\n if (isComplexV2(edit)) {\n return !edit.some((e) => !isEditV2(e));\n }\n \n return (\n isSetAttributesV2(edit) ||\n isSetTextContentV2(edit) ||\n isInsertV2(edit) ||\n isRemoveV2(edit)\n );\n}\n"]}
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
import { isComplexV2, isInsertV2, isRemoveV2, isSetAttributesV2, isSetTextContentV2, } from './edit.js';
|
|
2
|
-
function handleSetTextContent({ element, textContent, }) {
|
|
3
|
-
const { childNodes } = element;
|
|
4
|
-
const restoreChildNodes = Array.from(childNodes).map((node) => ({
|
|
5
|
-
parent: element,
|
|
6
|
-
node,
|
|
7
|
-
reference: null,
|
|
8
|
-
}));
|
|
9
|
-
element.textContent = textContent;
|
|
10
|
-
const undoTextContent = { element, textContent: '' };
|
|
11
|
-
return [undoTextContent, ...restoreChildNodes];
|
|
12
|
-
}
|
|
13
|
-
function uniqueNSPrefix(element, ns) {
|
|
14
|
-
let i = 1;
|
|
15
|
-
const attributes = Array.from(element.attributes);
|
|
16
|
-
const hasSamePrefix = (attribute) => attribute.prefix === `ens${i}` && attribute.namespaceURI !== ns;
|
|
17
|
-
const nsOrNull = new Set([null, ns]);
|
|
18
|
-
const differentNamespace = (prefix) => !nsOrNull.has(element.lookupNamespaceURI(prefix));
|
|
19
|
-
while (differentNamespace(`ens${i}`) || attributes.find(hasSamePrefix))
|
|
20
|
-
i += 1;
|
|
21
|
-
return `ens${i}`;
|
|
22
|
-
}
|
|
23
|
-
const xmlAttributeName = /^(?!xml|Xml|xMl|xmL|XMl|xML|XmL|XML)[A-Za-z_][A-Za-z0-9-_.]*(:[A-Za-z_][A-Za-z0-9-_.]*)?$/;
|
|
24
|
-
function validName(name) {
|
|
25
|
-
return xmlAttributeName.test(name);
|
|
26
|
-
}
|
|
27
|
-
function handleSetAttributes({ element, attributes, attributesNS, }) {
|
|
28
|
-
const oldAttributes = { ...attributes };
|
|
29
|
-
const oldAttributesNS = { ...attributesNS };
|
|
30
|
-
// save element's non-prefixed attributes for undo
|
|
31
|
-
Object.keys(attributes)
|
|
32
|
-
.reverse()
|
|
33
|
-
.forEach((name) => {
|
|
34
|
-
oldAttributes[name] = element.getAttribute(name);
|
|
35
|
-
});
|
|
36
|
-
// change element's non-prefixed attributes
|
|
37
|
-
for (const entry of Object.entries(attributes)) {
|
|
38
|
-
try {
|
|
39
|
-
const [name, value] = entry;
|
|
40
|
-
if (value === null)
|
|
41
|
-
element.removeAttribute(name);
|
|
42
|
-
else
|
|
43
|
-
element.setAttribute(name, value);
|
|
44
|
-
}
|
|
45
|
-
catch (_e) {
|
|
46
|
-
// undo nothing if update didn't work on this attribute
|
|
47
|
-
delete oldAttributes[entry[0]];
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// save element's namespaced attributes for undo
|
|
51
|
-
Object.entries(attributesNS).forEach(([ns, attrs]) => {
|
|
52
|
-
Object.keys(attrs)
|
|
53
|
-
.filter(validName)
|
|
54
|
-
.reverse()
|
|
55
|
-
.forEach((name) => {
|
|
56
|
-
oldAttributesNS[ns] = {
|
|
57
|
-
...oldAttributesNS[ns],
|
|
58
|
-
[name]: element.getAttributeNS(ns, name.split(':').pop()),
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
Object.keys(attrs)
|
|
62
|
-
.filter((name) => !validName(name))
|
|
63
|
-
.forEach((name) => {
|
|
64
|
-
delete oldAttributesNS[ns][name];
|
|
65
|
-
});
|
|
66
|
-
});
|
|
67
|
-
// change element's namespaced attributes
|
|
68
|
-
for (const nsEntry of Object.entries(attributesNS)) {
|
|
69
|
-
const [ns, attrs] = nsEntry;
|
|
70
|
-
for (const entry of Object.entries(attrs).filter(([name]) => validName(name))) {
|
|
71
|
-
try {
|
|
72
|
-
const [name, value] = entry;
|
|
73
|
-
if (value === null) {
|
|
74
|
-
element.removeAttributeNS(ns, name.split(':').pop());
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
let qualifiedName = name;
|
|
78
|
-
if (!qualifiedName.includes(':')) {
|
|
79
|
-
let prefix = element.lookupPrefix(ns);
|
|
80
|
-
if (!prefix)
|
|
81
|
-
prefix = uniqueNSPrefix(element, ns);
|
|
82
|
-
qualifiedName = `${prefix}:${name}`;
|
|
83
|
-
}
|
|
84
|
-
element.setAttributeNS(ns, qualifiedName, value);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
catch (_e) {
|
|
88
|
-
delete oldAttributesNS[ns][entry[0]];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
return {
|
|
93
|
-
element,
|
|
94
|
-
attributes: oldAttributes,
|
|
95
|
-
attributesNS: oldAttributesNS,
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
function handleRemove({ node }) {
|
|
99
|
-
const { parentNode: parent, nextSibling: reference } = node;
|
|
100
|
-
node.parentNode?.removeChild(node);
|
|
101
|
-
if (parent)
|
|
102
|
-
return {
|
|
103
|
-
node,
|
|
104
|
-
parent,
|
|
105
|
-
reference,
|
|
106
|
-
};
|
|
107
|
-
return [];
|
|
108
|
-
}
|
|
109
|
-
function handleInsert({ parent, node, reference, }) {
|
|
110
|
-
try {
|
|
111
|
-
const { parentNode, nextSibling } = node;
|
|
112
|
-
/**
|
|
113
|
-
* This is a workaround for converted edit api v1 events,
|
|
114
|
-
* because if multiple edits are converted, they are converted before the changes from the previous edits are applied to the document
|
|
115
|
-
* so if you first remove an element and then add a clone with changed attributes, the reference will be the element to remove since it hasnt been removed yet
|
|
116
|
-
*/
|
|
117
|
-
if (!parent.contains(reference)) {
|
|
118
|
-
reference = null;
|
|
119
|
-
}
|
|
120
|
-
parent.insertBefore(node, reference);
|
|
121
|
-
if (parentNode) {
|
|
122
|
-
// undo: move child node back to original place
|
|
123
|
-
return {
|
|
124
|
-
node,
|
|
125
|
-
parent: parentNode,
|
|
126
|
-
reference: nextSibling,
|
|
127
|
-
};
|
|
128
|
-
}
|
|
129
|
-
// undo: remove orphaned node
|
|
130
|
-
return { node };
|
|
131
|
-
}
|
|
132
|
-
catch (_e) {
|
|
133
|
-
// undo nothing if insert doesn't work on these nodes
|
|
134
|
-
return [];
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/** Applies an Edit, returning the corresponding 'undo' Edit. */
|
|
138
|
-
export function handleEditV2(edit) {
|
|
139
|
-
if (isInsertV2(edit))
|
|
140
|
-
return handleInsert(edit);
|
|
141
|
-
if (isRemoveV2(edit))
|
|
142
|
-
return handleRemove(edit);
|
|
143
|
-
if (isSetAttributesV2(edit))
|
|
144
|
-
return handleSetAttributes(edit);
|
|
145
|
-
if (isSetTextContentV2(edit))
|
|
146
|
-
return handleSetTextContent(edit);
|
|
147
|
-
if (isComplexV2(edit))
|
|
148
|
-
return edit.map((edit) => handleEditV2(edit)).reverse();
|
|
149
|
-
return [];
|
|
150
|
-
}
|
|
151
|
-
//# sourceMappingURL=handle-edit.js.map
|
|
@@ -1 +0,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UAAU;gBAClB,SAAS,EAAE,WAAW;aACvB,CAAC;SACH;QAED,6BAA6B;QAC7B,OAAO,EAAE,IAAI,EAAE,CAAC;KACjB;IAAC,OAAO,EAAE,EAAE;QACX,qDAAqD;QACrD,OAAO,EAAE,CAAC;KACX;AACH,CAAC;AAED,gEAAgE;AAChE,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,IAAI,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;IAChD,IAAI,iBAAiB,CAAC,IAAI,CAAC;QAAE,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,kBAAkB,CAAC,IAAI,CAAC;QAAE,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC;IAChE,IAAI,WAAW,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;IAE/E,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["import {\n EditV2,\n InsertV2,\n isComplexV2,\n isInsertV2,\n isRemoveV2,\n isSetAttributesV2,\n isSetTextContentV2,\n RemoveV2,\n SetAttributesV2,\n SetTextContentV2,\n} from './edit.js';\n\nfunction handleSetTextContent({\n element,\n textContent,\n}: SetTextContentV2): (SetTextContentV2 | InsertV2)[] {\n const { childNodes } = element;\n \n const restoreChildNodes: InsertV2[] = Array.from(childNodes).map((node) => ({\n parent: element,\n node,\n reference: null,\n }));\n \n element.textContent = textContent;\n \n const undoTextContent: SetTextContentV2 = { element, textContent: '' };\n \n return [undoTextContent, ...restoreChildNodes];\n}\n\nfunction uniqueNSPrefix(element: Element, ns: string): string {\n let i = 1;\n const attributes = Array.from(element.attributes);\n const hasSamePrefix = (attribute: Attr) =>\n attribute.prefix === `ens${i}` && attribute.namespaceURI !== ns;\n const nsOrNull = new Set([null, ns]);\n const differentNamespace = (prefix: string) =>\n !nsOrNull.has(element.lookupNamespaceURI(prefix));\n while (differentNamespace(`ens${i}`) || attributes.find(hasSamePrefix))\n i += 1;\n return `ens${i}`;\n}\n\nconst xmlAttributeName = /^(?!xml|Xml|xMl|xmL|XMl|xML|XmL|XML)[A-Za-z_][A-Za-z0-9-_.]*(:[A-Za-z_][A-Za-z0-9-_.]*)?$/;\n\nfunction validName(name: string): boolean {\n return xmlAttributeName.test(name);\n}\n\nfunction handleSetAttributes({\n element,\n attributes,\n attributesNS,\n}: SetAttributesV2): SetAttributesV2 {\n const oldAttributes = { ...attributes };\n const oldAttributesNS = { ...attributesNS };\n \n // save element's non-prefixed attributes for undo\n Object.keys(attributes)\n .reverse()\n .forEach((name) => {\n oldAttributes[name] = element.getAttribute(name);\n });\n \n // change element's non-prefixed attributes\n for (const entry of Object.entries(attributes)) {\n try {\n const [name, value] = entry as [string, string | null];\n if (value === null) element.removeAttribute(name);\n else element.setAttribute(name, value);\n } catch (_e) {\n // undo nothing if update didn't work on this attribute\n delete oldAttributes[entry[0]];\n }\n }\n \n // save element's namespaced attributes for undo\n Object.entries(attributesNS).forEach(([ns, attrs]) => {\n Object.keys(attrs!)\n .filter(validName)\n .reverse()\n .forEach((name) => {\n oldAttributesNS[ns] = {\n ...oldAttributesNS[ns],\n [name]: element.getAttributeNS(ns, name.split(':').pop()!),\n };\n });\n Object.keys(attrs!)\n .filter((name) => !validName(name))\n .forEach((name) => {\n delete oldAttributesNS[ns]![name];\n });\n });\n \n // change element's namespaced attributes\n for (const nsEntry of Object.entries(attributesNS)) {\n const [ns, attrs] = nsEntry as [\n string,\n Partial<Record<string, string | null>>,\n ];\n for (const entry of Object.entries(attrs).filter(([name]) =>\n validName(name),\n )) {\n try {\n const [name, value] = entry as [string, string | null];\n if (value === null) {\n element.removeAttributeNS(ns, name.split(':').pop()!);\n } else {\n let qualifiedName = name;\n if (!qualifiedName.includes(':')) {\n let prefix = element.lookupPrefix(ns);\n if (!prefix) prefix = uniqueNSPrefix(element, ns);\n qualifiedName = `${prefix}:${name}`;\n }\n element.setAttributeNS(ns, qualifiedName, value);\n }\n } catch (_e) {\n delete oldAttributesNS[ns]![entry[0]];\n }\n }\n}\n\nreturn {\n element,\n attributes: oldAttributes,\n attributesNS: oldAttributesNS,\n};\n}\n\nfunction handleRemove({ node }: RemoveV2): InsertV2 | [] {\n const { parentNode: parent, nextSibling: reference } = node;\n node.parentNode?.removeChild(node);\n if (parent)\n return {\n node,\n parent,\n reference,\n };\n return [];\n}\n\nfunction handleInsert({\n parent,\n node,\n reference,\n}: InsertV2): InsertV2 | RemoveV2 | [] {\n try {\n const { parentNode, nextSibling } = node;\n\n /**\n * This is a workaround for converted edit api v1 events,\n * because if multiple edits are converted, they are converted before the changes from the previous edits are applied to the document\n * so if you first remove an element and then add a clone with changed attributes, the reference will be the element to remove since it hasnt been removed yet\n */\n if (!parent.contains(reference)) {\n reference = null;\n }\n\n parent.insertBefore(node, reference);\n\n if (parentNode) {\n // undo: move child node back to original place\n return {\n node,\n parent: parentNode,\n reference: nextSibling,\n };\n }\n\n // undo: remove orphaned node\n return { node };\n } catch (_e) {\n // undo nothing if insert doesn't work on these nodes\n return [];\n }\n}\n\n/** Applies an Edit, returning the corresponding 'undo' Edit. */\nexport function handleEditV2(edit: EditV2): EditV2 {\n if (isInsertV2(edit)) return handleInsert(edit);\n if (isRemoveV2(edit)) return handleRemove(edit);\n if (isSetAttributesV2(edit)) return handleSetAttributes(edit);\n if (isSetTextContentV2(edit)) return handleSetTextContent(edit);\n if (isComplexV2(edit)) return edit.map((edit) => handleEditV2(edit)).reverse();\n \n return [];\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"open-event.js","sourceRoot":"","sources":["../../../../core/foundation/open-event.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,YAAY,CAAC,GAAgB,EAAE,OAAe;IAC5D,OAAO,IAAI,WAAW,CAAa,WAAW,EAAE;QAC9C,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE;KACzB,CAAC,CAAC;AACL,CAAC","sourcesContent":["export type OpenDetail = {\n doc: XMLDocument;\n docName: string;\n};\n\n/** Represents the intent to open `doc` with filename `docName`. */\nexport type OpenEvent = CustomEvent<OpenDetail>;\n\nexport function newOpenEvent(doc: XMLDocument, docName: string): OpenEvent {\n return new CustomEvent<OpenDetail>('oscd-open', {\n bubbles: true,\n composed: true,\n detail: { doc, docName },\n });\n}\n\ndeclare global {\n interface ElementEventMap {\n ['oscd-open']: OpenEvent;\n }\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../core/foundation/plugin.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC","sourcesContent":["import { targetLocales } from '../locales.js';\n\nexport type Plugin = {\n // name defines the name of the plugin\n name: string;\n // src defines the path to the plugins source file\n src: string;\n // kind defines the type of the plugin\n kind: PluginKind;\n // activeByDefault configures if the plugin should be active by default\n // this is will be user when users resets the plugins\n activeByDefault: boolean;\n // icon stores the icon name of the Material Icon\n icon?: string;\n // active shows if the plugin currently is active\n active?: boolean;\n // requireDoc shows if the plugin requires a document to be loaded\n requireDoc?: boolean;\n // position defines the position of menu plugins\n position?: MenuPosition\n translations?: Record<(typeof targetLocales)[number], string>;\n};\n\nexport type PluginSet = { menu: Plugin[]; editor: Plugin[] };\nexport type PluginKind = 'editor' | 'menu' | 'validator';\nexport const menuPosition = ['top', 'middle', 'bottom'] as const;\nexport type MenuPosition = (typeof menuPosition)[number];\n\n"]}
|
package/dist/core/foundation.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export { newOpenEvent } from './foundation/open-event.js';
|
|
2
|
-
export { newEditEvent, isComplex, isInsert, isNamespaced, isUpdate, isRemove, } from './foundation/deprecated/edit-event.js';
|
|
3
|
-
export { isEditV2, isRemoveV2, isInsertV2, isComplexV2, isSetAttributesV2, isSetTextContentV2 } from './foundation/edit.js';
|
|
4
|
-
export { newEditEventV2 } from './foundation/edit-event.js';
|
|
5
|
-
export { handleEditV2 } from './foundation/handle-edit.js';
|
|
6
|
-
export { cyrb64 } from './foundation/cyrb64.js';
|
|
7
|
-
export { newEditCompletedEvent } from './foundation/edit-completed-event.js';
|
|
8
|
-
/** @returns the cartesian product of `arrays` */
|
|
9
|
-
export function crossProduct(...arrays) {
|
|
10
|
-
return arrays.reduce((a, b) => a.flatMap(d => b.map(e => [d, e].flat())), [[]]);
|
|
11
|
-
}
|
|
12
|
-
export { OscdApi } from './api/api.js';
|
|
13
|
-
export { XMLEditor } from './api/editor/xml-editor.js';
|
|
14
|
-
//# sourceMappingURL=foundation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"foundation.js","sourceRoot":"","sources":["../../../core/foundation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAG1D,OAAO,EACL,YAAY,EACZ,SAAS,EACT,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,QAAQ,GACT,MAAM,uCAAuC,CAAC;AAkB/C,OAAO,EACL,QAAQ,EACR,UAAU,EACV,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EACnB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAIhD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAO7E,iDAAiD;AACjD,MAAM,UAAU,YAAY,CAAI,GAAG,MAAa;IAC9C,OAAO,MAAM,CAAC,MAAM,CAClB,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAQ,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,EAC1D,CAAC,EAAE,CAAC,CACL,CAAC;AACJ,CAAC;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["import { LitElement } from 'lit';\n\n/** Constructor type for defining `LitElement` mixins. */\nexport type LitElementConstructor = new (...args: any[]) => LitElement;\n\nexport { newOpenEvent } from './foundation/open-event.js';\nexport type { OpenEvent, OpenDetail } from './foundation/open-event.js';\n\nexport {\n newEditEvent,\n isComplex,\n isInsert,\n isNamespaced,\n isUpdate,\n isRemove,\n} from './foundation/deprecated/edit-event.js';\nexport type {\n EditEvent,\n Edit,\n Insert,\n AttributeValue,\n NamespacedAttributeValue,\n Update,\n Remove,\n} from './foundation/deprecated/edit-event.js';\n\nexport type {\n EditV2,\n InsertV2,\n RemoveV2,\n SetTextContentV2,\n SetAttributesV2,\n} from './foundation/edit.js';\nexport {\n isEditV2,\n isRemoveV2,\n isInsertV2,\n isComplexV2,\n isSetAttributesV2,\n isSetTextContentV2\n} from './foundation/edit.js';\nexport type {\n EditEventV2,\n EditEventOptionsV2,\n EditDetailV2\n} from './foundation/edit-event.js';\nexport { newEditEventV2 } from './foundation/edit-event.js';\n\nexport { handleEditV2 } from './foundation/handle-edit.js';\n\nexport { cyrb64 } from './foundation/cyrb64.js';\n\nexport type { Plugin, PluginSet } from './foundation/plugin.js';\n\nexport { newEditCompletedEvent } from './foundation/edit-completed-event.js';\n\nexport type {\n EditCompletedEvent,\n EditCompletedDetail,\n} from './foundation/edit-completed-event.js';\n\n/** @returns the cartesian product of `arrays` */\nexport function crossProduct<T>(...arrays: T[][]): T[][] {\n return arrays.reduce<T[][]>(\n (a, b) => <T[][]>a.flatMap(d => b.map(e => [d, e].flat())),\n [[]]\n );\n}\n\nexport { OscdApi } from './api/api.js';\n\nexport { XMLEditor } from './api/editor/xml-editor.js';\n"]}
|
package/dist/core/locales.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// Do not modify this file by hand!
|
|
2
|
-
// Re-generate this file by running lit-localize.
|
|
3
|
-
/**
|
|
4
|
-
* The locale code that templates in this source code are written in.
|
|
5
|
-
*/
|
|
6
|
-
export const sourceLocale = `en`;
|
|
7
|
-
/**
|
|
8
|
-
* The other locale codes that this application is localized into. Sorted
|
|
9
|
-
* lexicographically.
|
|
10
|
-
*/
|
|
11
|
-
export const targetLocales = [
|
|
12
|
-
`de`,
|
|
13
|
-
];
|
|
14
|
-
/**
|
|
15
|
-
* All valid project locale codes. Sorted lexicographically.
|
|
16
|
-
*/
|
|
17
|
-
export const allLocales = [
|
|
18
|
-
`de`,
|
|
19
|
-
`en`,
|
|
20
|
-
];
|
|
21
|
-
//# sourceMappingURL=locales.js.map
|
package/dist/core/locales.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../../core/locales.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,iDAAiD;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC;AAEjC;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,IAAI;CACI,CAAC;AAEX;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,IAAI;IACJ,IAAI;CACI,CAAC","sourcesContent":["// Do not modify this file by hand!\n// Re-generate this file by running lit-localize.\n\n/**\n * The locale code that templates in this source code are written in.\n */\nexport const sourceLocale = `en`;\n\n/**\n * The other locale codes that this application is localized into. Sorted\n * lexicographically.\n */\nexport const targetLocales = [\n `de`,\n] as const;\n\n/**\n * All valid project locale codes. Sorted lexicographically.\n */\nexport const allLocales = [\n `de`,\n `en`,\n] as const;\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"WizardDivider.js","sourceRoot":"","sources":["../../../src/WizardDivider.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,aAAa,EACb,IAAI,EACJ,UAAU,EACV,QAAQ,GAET,MAAM,aAAa,CAAC;AAGd,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAMlD,MAAM;QACJ,OAAO,IAAI,CAAA,IAAI,IAAI,CAAC,YAAY,EAAE,IAAI,IAAI,CAAC,eAAe,EAAE,EAAE,CAAC;IACjE,CAAC;IAEO,YAAY;QAClB,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YAChB,OAAO,IAAI,CAAA,EAAE,CAAC;SACf;QAED,OAAO,IAAI,CAAA,sBAAsB,IAAI,CAAC,MAAM,OAAO,CAAC;IACtD,CAAC;IAEO,eAAe;QACrB,OAAO,IAAI,CAAA,8BAA8B,CAAC;IAC5C,CAAC;;AAEM,2BAAM,GAAG,GAAG,CAAA;;;;;;;;;;GAUlB,CAAC;AA5BF;IAHC,QAAQ,CAAC;QACR,IAAI,EAAE,MAAM;KACb,CAAC;oDACc;AAJL,oBAAoB;IADhC,aAAa,CAAC,gBAAgB,CAAC;GACnB,oBAAoB,CAiChC;SAjCY,oBAAoB","sourcesContent":["import {\n css,\n customElement,\n html,\n LitElement,\n property,\n TemplateResult,\n} from 'lit-element';\n\n@customElement('wizard-divider')\nexport class WizardDividerElement extends LitElement {\n @property({\n type: String,\n })\n header?: string;\n\n render(): TemplateResult {\n return html` ${this.renderHeader()} ${this.renderSeparator()}`;\n }\n\n private renderHeader(): TemplateResult {\n if (!this.header) {\n return html``;\n }\n\n return html`<h4 class=\"header\">${this.header}</h4>`;\n }\n\n private renderSeparator(): TemplateResult {\n return html`<div role=\"separator\"></div>`;\n }\n\n static styles = css`\n div {\n height: 0px;\n margin: 10px 0px 10px 0px;\n border-top: none;\n border-right: none;\n border-left: none;\n border-image: initial;\n border-bottom: 1px solid rgba(0, 0, 0, 0.12);\n }\n `;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Wizarding.js","sourceRoot":"","sources":["../../../src/Wizarding.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,KAAK,EAAkB,KAAK,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,aAAa,GAKd,MAAM,iBAAiB,CAAC;AAEzB,OAAO,oBAAoB,CAAC;AAO5B,MAAM,UAAU,SAAS,CAAsC,IAAW;IACxE,MAAM,gBAAiB,SAAQ,IAAI;QAOzB,QAAQ,CAAC,EAAe;YAC9B,MAAM,MAAM,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC;YAChC,IAAI,MAAM,KAAK,IAAI;gBAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;iBACtC,IAAI,EAAE,CAAC,MAAM,CAAC,SAAS;gBAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;;gBACvD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAChC,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;YAC/B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAC5B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CACrC,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,CAC7C,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,CAC9B,CACF,CACF,CAAC;QACJ,CAAC;QAED,YAAY,GAAG,IAAW;YACxB,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;YAtBjB,8CAA8C;YAE9C,aAAQ,GAAoB,EAAE,CAAC;YAsB7B,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;YAC/C,IAAI,CAAC,gBAAgB,CAAC,eAAe,EAAE,GAAG,EAAE,CAC1C,IAAI,CAAC,QAAQ,CAAC,aAAa,EAAE,CAC9B,CAAC;QACJ,CAAC;QAED,MAAM;YACJ,OAAO,IAAI,CAAA,GAAG,aAAa,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC;iCAChB,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,mBAAmB,CAAC;QAC3E,CAAC;KACF;IAhCC;QADC,KAAK,EAAE;sDACuB;IAEP;QAAvB,KAAK,CAAC,eAAe,CAAC;sDAAyB;IAgClD,OAAO,gBAAgB,CAAC;AAC1B,CAAC","sourcesContent":["import { html, state, TemplateResult, query } from 'lit-element';\nimport {\n ifImplemented,\n LitElementConstructor,\n Mixin,\n WizardEvent,\n WizardFactory,\n} from './foundation.js';\n\nimport './wizard-dialog.js';\nimport { WizardDialog } from './wizard-dialog.js';\n\n/** `LitElement` mixin that adds a `workflow` property which [[`Wizard`]]s are\n * queued onto on incoming [[`WizardEvent`]]s, first come first displayed. */\nexport type WizardingElement = Mixin<typeof Wizarding>;\n\nexport function Wizarding<TBase extends LitElementConstructor>(Base: TBase) {\n class WizardingElement extends Base {\n /** FIFO queue of [[`Wizard`]]s to display. */\n @state()\n workflow: WizardFactory[] = [];\n\n @query('wizard-dialog') wizardUI!: WizardDialog;\n\n private onWizard(we: WizardEvent) {\n const wizard = we.detail.wizard;\n if (wizard === null) this.workflow.shift();\n else if (we.detail.subwizard) this.workflow.unshift(wizard);\n else this.workflow.push(wizard);\n this.requestUpdate('workflow');\n this.updateComplete.then(() =>\n this.wizardUI.updateComplete.then(() =>\n this.wizardUI.dialog?.updateComplete.then(() =>\n this.wizardUI.dialog?.focus()\n )\n )\n );\n }\n\n constructor(...args: any[]) {\n super(...args);\n\n this.addEventListener('wizard', this.onWizard);\n this.addEventListener('editor-action', () =>\n this.wizardUI.requestUpdate()\n );\n }\n\n render(): TemplateResult {\n return html`${ifImplemented(super.render())}\n <wizard-dialog .wizard=${this.workflow[0]?.() ?? []}></wizard-dialog>`;\n }\n }\n\n return WizardingElement;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-icon.js","sourceRoot":"","sources":["../../../src/action-icon.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,aAAa,EACb,IAAI,EACJ,UAAU,EACV,QAAQ,GAET,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,OAAO,oBAAoB,CAAC;AAE5B;;;;;;GAMG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAOL,oEAAoE;QAEpE,cAAS,GAAG,KAAK,CAAC;QAClB,yCAAyC;QAEzC,gBAAW,GAAG,KAAK,CAAC;QACpB,8CAA8C;QAE9C,gBAAW,GAAG,KAAK,CAAC;IAuLtB,CAAC;IArLC,KAAK,CAAC,YAAY;QAChB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC;IAEO,UAAU;QAChB,OAAO,IAAI,CAAA;;WAEJ,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAA,aAAa,IAAI,CAAC,IAAI,aAAa,CAAC,CAAC,CAAC,OAAO;;OAEjE,CAAC;IACN,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAA,WAAW,IAAI,CAAC,KAAK,IAAI,OAAO;iBAC9B,IAAI,CAAC,UAAU,EAAE;gBAClB,IAAI,CAAC,KAAK,IAAI,OAAO,WAAW,CAAC;IAC/C,CAAC;;AAEM,iBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkKlB,CAAC;AAlMF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACZ;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACV;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACR;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACR;AAfT,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAsMtB;SAtMY,UAAU","sourcesContent":["import {\n css,\n customElement,\n html,\n LitElement,\n property,\n TemplateResult,\n} from 'lit-element';\nimport { nothing } from 'lit-html';\n\nimport '@material/mwc-icon';\n\n/**\n * A responsive container rendering actions in a header.\n *\n * The \"action\" slot may contain up to eight icon buttons.\n * The \"icon\" slot, if filled overrides the icon property.\n * The default slot will be rendered into the pane body in a single column.\n */\n@customElement('action-icon')\nexport class ActionIcon extends LitElement {\n /** caption text, displayed in the header */\n @property({ type: String })\n label?: string;\n /** icon name, displayed unless the \"icon\" slot is filled */\n @property({ type: String })\n icon?: string;\n /** color header with secondary theme color while focus is within */\n @property({ type: Boolean })\n secondary = false;\n /** highlight pane with dotted outline */\n @property({ type: Boolean })\n highlighted = false;\n /** disables CSS adoption to action buttons */\n @property({ type: Boolean })\n hideActions = false;\n\n async firstUpdated(): Promise<void> {\n this.tabIndex = 0;\n }\n\n private renderIcon(): TemplateResult {\n return html`<span>\n <slot name=\"icon\"\n >${this.icon ? html`<mwc-icon>${this.icon}</mwc-icon>` : nothing}</slot\n ></span\n > `;\n }\n\n render(): TemplateResult {\n return html`<header>${this.label ?? nothing}</header>\n <section>${this.renderIcon()}<slot name=\"action\"></slot></section>\n <footer>${this.label ?? nothing}</footer>`;\n }\n\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n outline: none;\n }\n\n section {\n align-self: center;\n }\n\n ::slotted([slot='icon']),\n mwc-icon {\n display: block;\n color: var(--mdc-theme-on-surface);\n transition: transform 150ms linear, box-shadow 200ms linear;\n outline-color: var(--mdc-theme-primary);\n outline-style: solid;\n margin: 0px;\n outline-width: 0px;\n width: 64px;\n height: 64px;\n --mdc-icon-size: 64px;\n }\n\n :host([secondary]) ::slotted([slot='icon']),\n :host([secondary]) mwc-icon {\n outline-color: var(--mdc-theme-secondary);\n }\n\n :host([highlighted]) ::slotted([slot='icon']),\n :host([highlighted]) mwc-icon {\n outline-style: dotted;\n outline-width: 2px;\n }\n\n :host(:focus-within) ::slotted([slot='icon']),\n :host(:focus-within) mwc-icon {\n outline-style: solid;\n outline-width: 4px;\n }\n\n :host(:focus-within:not([hideActions])) ::slotted([slot='icon']),\n :host(:focus-within:not([hideActions])) mwc-icon {\n transform: scale(0.8);\n transition: all 250ms linear;\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n }\n\n ::slotted([slot='icon']:hover),\n mwc-icon:hover {\n outline-style: dashed;\n outline-width: 2px;\n transition: transform 200ms linear, box-shadow 250ms linear;\n }\n\n ::slotted([slot='action']) {\n color: var(--mdc-theme-on-surface);\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1),\n opacity 200ms linear;\n position: absolute;\n pointer-events: none;\n z-index: 1;\n opacity: 0;\n margin-top: -56px;\n margin-left: 8px;\n }\n\n :host(:focus-within) ::slotted([slot='action']) {\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),\n opacity 250ms linear;\n pointer-events: auto;\n opacity: 1;\n }\n\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(1)) {\n transform: translate(0px, -52px);\n }\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(2)) {\n transform: translate(0px, 52px);\n }\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(3)) {\n transform: translate(52px, 0px);\n }\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(4)) {\n transform: translate(-52px, 0px);\n }\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(5)) {\n transform: translate(52px, -52px);\n }\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(6)) {\n transform: translate(-52px, 52px);\n }\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(7)) {\n transform: translate(-52px, -52px);\n }\n :host(:focus-within) ::slotted([slot='action']:nth-of-type(8)) {\n transform: translate(52px, 52px);\n }\n\n footer {\n color: var(--mdc-theme-on-surface);\n font-family: 'Roboto', sans-serif;\n font-weight: 300;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin: 0px;\n text-align: center;\n align-self: center;\n max-width: 100%;\n direction: rtl;\n }\n\n header {\n color: var(--mdc-theme-on-primary);\n background-color: var(--mdc-theme-primary);\n font-family: 'Roboto', sans-serif;\n font-weight: 500;\n font-size: 1.2em;\n position: absolute;\n text-align: center;\n align-self: center;\n max-width: 100vw;\n padding: 4px 8px;\n border-radius: 4px;\n opacity: 0;\n transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1),\n opacity 200ms linear;\n }\n\n :host([secondary]) header {\n background-color: var(--mdc-theme-secondary);\n }\n\n :host(:hover) header {\n position: absolute;\n opacity: 1;\n transform: translate(0, -40px);\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),\n opacity 250ms linear;\n }\n\n :host(:focus-within) header {\n position: absolute;\n opacity: 1;\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1),\n opacity 250ms linear;\n }\n\n :host(:focus-within:not([hideActions])) header {\n transform: translate(0, -80px);\n }\n\n :host(:focus-within[hideActions]) header {\n transform: translate(0, -40px);\n }\n `;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"action-pane.js","sourceRoot":"","sources":["../../../src/action-pane.ts"],"names":[],"mappings":";AAAA,OAAO,EACL,GAAG,EACH,aAAa,EACb,IAAI,EACJ,UAAU,EACV,QAAQ,GAET,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEnC,SAAS,SAAS,CAAoB,IAAU,EAAE,QAAgB;IAChE,MAAM,OAAO,GACX,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,YAAY;QACjC,CAAC,CAAW,IAAK,CAAC,OAAO,CAAI,QAAQ,CAAC;QACtC,CAAC,CAAC,IAAI,CAAC;IAEX,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAE5B,MAAM,IAAI,GAAgC,IAAI,CAAC,WAAW,EAAE,CAAC;IAE7D,IAAI,IAAI,YAAY,UAAU;QAAE,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEtE,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;GAMG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAOL,oEAAoE;QAEpE,cAAS,GAAG,KAAK,CAAC;QAClB,yCAAyC;QAEzC,gBAAW,GAAG,KAAK,CAAC;QACpB,iEAAiE;QAEjE,UAAK,G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;YAChB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,UAAU,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,KAAK,CAAC;SACjC,CAAC;;QAEA,IAAI,CAAC,YAAY,EAAE;;eAEZ,CAAC;IACd,CAAC;;AAEM,iBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8ElB,CAAC;AA5IF;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACZ;AAGf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCACb;AAGd;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;6CACV;AAGlB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;+CACR;AAGpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCACjB;AAfC,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAgJtB;SAhJY,UAAU","sourcesContent":["import {\n css,\n customElement,\n html,\n LitElement,\n property,\n TemplateResult,\n} from 'lit-element';\nimport { classMap } from 'lit-html/directives/class-map';\n\nimport '@material/mwc-icon';\nimport { nothing } from 'lit-html';\n\nfunction closestTo<E extends Element>(node: Node, selector: string): E | null {\n const closest =\n node.nodeType === Node.ELEMENT_NODE\n ? (<Element>node).closest<E>(selector)\n : null;\n\n if (closest) return closest;\n\n const root = <Document | DocumentFragment>node.getRootNode();\n\n if (root instanceof ShadowRoot) return closestTo(root.host, selector);\n\n return null;\n}\n\n/**\n * A responsive container rendering actions in a header.\n *\n * The \"action\" slot may contain up to eight icon buttons.\n * The \"icon\" slot, if filled overrides the icon property.\n * The default slot will be rendered into the pane body in a single column.\n */\n@customElement('action-pane')\nexport class ActionPane extends LitElement {\n /** caption text, displayed in the header */\n @property({ type: String })\n label?: string;\n /** icon name, displayed unless the \"icon\" slot is filled */\n @property({ type: String })\n icon?: string;\n /** color header with secondary theme color while focus is within */\n @property({ type: Boolean })\n secondary = false;\n /** highlight pane with dotted outline */\n @property({ type: Boolean })\n highlighted = false;\n /** nesting level, default (closest pane ancestor's level) + 1 */\n @property({ type: Number })\n level = 1;\n\n async firstUpdated(): Promise<void> {\n this.tabIndex = 0;\n\n const parentPane = closestTo<ActionPane>(this.parentNode!, 'action-pane');\n if (parentPane) this.level = parentPane.level + 1;\n\n this.level = Math.floor(this.level);\n }\n\n private renderHeader(): TemplateResult {\n const content = html`<span\n ><slot name=\"icon\"\n >${this.icon\n ? html`<mwc-icon>${this.icon}</mwc-icon>`\n : nothing}</slot\n ></span\n >\n ${this.label ?? nothing}\n <nav><slot name=\"action\"></slot></nav>`;\n\n const headingLevel = Math.floor(Math.max(this.level, 1));\n // Sometimes a TemplateResult is passed in as Label, not a string. So only when it's a string show a title.\n const title = typeof this.label === 'string' ? this.label : '';\n switch (headingLevel) {\n case 1:\n return html`<h1 title=\"${title}\">${content}</h1>`;\n case 2:\n return html`<h2 title=\"${title}\">${content}</h2>`;\n case 3:\n return html`<h3 title=\"${title}\">${content}</h3>`;\n default:\n return html`<h4 title=\"${title}\">${content}</h4>`;\n }\n }\n\n render(): TemplateResult {\n return html`<section\n class=\"${classMap({\n secondary: this.secondary,\n highlighted: this.highlighted,\n contrasted: this.level % 2 === 0,\n })}\"\n >\n ${this.renderHeader()}\n <div><slot></slot></div>\n </section>`;\n }\n\n static styles = css`\n :host {\n outline: none;\n }\n\n :host(:focus-within) section {\n box-shadow: 0 8px 10px 1px rgba(0, 0, 0, 0.14),\n 0 3px 14px 2px rgba(0, 0, 0, 0.12), 0 5px 5px -3px rgba(0, 0, 0, 0.2);\n outline-width: 4px;\n transition: all 250ms linear;\n }\n\n section {\n background-color: var(--mdc-theme-surface);\n transition: all 200ms linear;\n outline-style: solid;\n margin: 0px;\n outline-width: 0px;\n outline-color: var(--mdc-theme-primary);\n }\n\n section.secondary {\n outline-color: var(--mdc-theme-secondary);\n }\n\n section > div {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 8px 12px 16px;\n clear: right;\n }\n\n .highlighted {\n outline-style: dotted;\n outline-width: 2px;\n }\n\n :host(:focus-within) .highlighted {\n outline-style: solid;\n }\n\n .contrasted {\n background-color: var(--mdc-theme-on-primary);\n }\n\n h1,\n h2,\n h3,\n h4 {\n color: var(--mdc-theme-on-surface);\n font-family: 'Roboto', sans-serif;\n font-weight: 300;\n overflow: clip visible;\n white-space: nowrap;\n text-overflow: ellipsis;\n margin: 0px;\n line-height: 52px;\n padding-left: 0.3em;\n }\n\n nav {\n float: right;\n }\n\n mwc-icon {\n vertical-align: middle;\n position: relative;\n top: -0.1em;\n --mdc-icon-size: 1em;\n }\n\n ::slotted([slot='icon']) {\n vertical-align: middle;\n position: relative;\n top: -0.1em;\n --mdc-icon-size: 1em;\n }\n `;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../../../src/addons/Editor.ts"],"names":[],"mappings":";AAAA,OAAO,EAGL,YAAY,EACZ,cAAc,EAEf,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,QAAQ,EACR,UAAU,EACV,aAAa,EAEb,IAAI,GACL,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAOpC,OAAO,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAC7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AAGrF,OAAO,EAGL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,C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E5C,MAAM,IAAI,CAAC,cAAc,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACzC,CAAC;CACF,CAAA;AAvFC;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;uCACA;AAEH;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;2CAAc;AAEb;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAY;AAEX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;0CAAoB;AAK/C;IAHC,QAAQ,CAAC;QACR,IAAI,EAAE,MAAM;KACb,CAAC;wCACiB;AAdR,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CA0FtB;SA1FY,UAAU;AA4FvB,SAAS,qBAAqB,CAAC,KAA2B;IACxD,MAAM,WAAW,GAAG,KAAK,CAAC,MAAc,CAAC;IACzC,OAAO,SAAS,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC,IAAI,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC3G,CAAC;AAED,SAAS,qCAAqC,CAAC,KAA2B;IACxE,MAAM,WAAW,GAAG,KAAK,CAAC,MAAc,CAAC;IACzC,OAAO,YAAY,CAAC,WAAW,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import {\n EditEventV2,\n OpenEvent,\n newEditEvent,\n newEditEventV2,\n XMLEditor\n} from '@openscd/core';\nimport {\n property,\n LitElement,\n customElement,\n TemplateResult,\n html,\n} from 'lit-element';\nimport { get } from 'lit-translate';\n\nimport {\n EditorAction,\n EditorActionEvent,\n} from '@openscd/core/foundation/deprecated/editor.js';\n\nimport { newLogEvent } from '@openscd/core/foundation/deprecated/history.js';\nimport { newValidateEvent } from '@openscd/core/foundation/deprecated/validation.js';\nimport { OpenDocEvent } from '@openscd/core/foundation/deprecated/open-event.js';\n\nimport {\n Edit,\n EditEvent,\n isComplex,\n isInsert,\n isRemove,\n isUpdate,\n} from '@openscd/core';\n\nimport { convertEditActiontoV1 } from './editor/edit-action-to-v1-converter.js';\nimport { convertEditV1toV2 } from './editor/edit-v1-to-v2-converter.js';\n\n@customElement('oscd-editor')\nexport class OscdEditor extends LitElement {\n /** The `XMLDocument` to be edited */\n @property({ attribute: false })\n doc: XMLDocument | null = null;\n /** The name of the current [[`doc`]] */\n @property({ type: String }) docName = '';\n /** The UUID of the current [[`doc`]] */\n @property({ type: String }) docId = '';\n /** XML Editor to apply changes to the scd */\n @property({ type: Object }) editor!: XMLEditor;\n\n @property({\n type: Object,\n })\n host!: HTMLElement;\n\n private onAction(event: EditorActionEvent<EditorAction>) {\n const edit = convertEditActiontoV1(event.detail.action);\n const editV2 = convertEditV1toV2(edit);\n\n this.host.dispatchEvent(newEditEventV2(editV2));\n }\n\n handleEditEvent(event: EditEvent) {\n /**\n * This is a compatibility fix for plugins based on open energy tools edit events\n * because their edit event look slightly different\n * see https://github.com/OpenEnergyTools/open-scd-core/blob/main/foundation/edit-event-v1.ts for details\n */\n if (isOpenEnergyEditEvent(event)) {\n event = convertOpenEnergyEditEventToEditEvent(event);\n }\n\n const edit = event.detail.edit;\n const editV2 = convertEditV1toV2(edit);\n\n this.host.dispatchEvent(newEditEventV2(editV2));\n }\n\n /**\n *\n * @deprecated [Move to handleOpenDoc instead]\n */\n private async onOpenDoc(event: OpenDocEvent) {\n this.doc = event.detail.doc;\n this.docName = event.detail.docName;\n this.docId = event.detail.docId ?? '';\n\n await this.updateComplete;\n\n this.dispatchEvent(newValidateEvent());\n\n this.dispatchEvent(\n newLogEvent({\n kind: 'info',\n title: get('openSCD.loaded', { name: this.docName }),\n })\n );\n }\n\n handleOpenDoc({ detail: { docName, doc } }: OpenEvent) {\n this.doc = doc;\n this.docName = docName;\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n // Deprecated editor action API, use 'oscd-edit' instead.\n this.host.addEventListener('editor-action', this.onAction.bind(this));\n // Deprecated edit event API, use 'oscd-edit-v2' instead.\n this.host.addEventListener('oscd-edit', event => this.handleEditEvent(event));\n\n this.host.addEventListener('oscd-edit-v2', event => this.handleEditEventV2(event));\n this.host.addEventListener('open-doc', this.onOpenDoc);\n this.host.addEventListener('oscd-open', this.handleOpenDoc);\n }\n\n render(): TemplateResult {\n return html`<slot></slot>`;\n }\n\n async handleEditEventV2(event: EditEventV2) {\n const { edit, title, squash } = event.detail;\n\n this.editor.commit(edit, { title, squash });\n\n await this.updateComplete;\n this.dispatchEvent(newValidateEvent());\n }\n}\n\nfunction isOpenEnergyEditEvent(event: CustomEvent<unknown>): boolean {\n const eventDetail = event.detail as Edit;\n return isComplex(eventDetail) || isInsert(eventDetail) || isUpdate(eventDetail) || isRemove(eventDetail);\n}\n\nfunction convertOpenEnergyEditEventToEditEvent(event: CustomEvent<unknown>): EditEvent {\n const eventDetail = event.detail as Edit;\n return newEditEvent(eventDetail);\n}\n"]}
|