@punica/editor 1.0.2 → 1.0.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/impl/activityBar/index.js +75 -0
- package/dist/impl/commands/index.js +52 -0
- package/dist/impl/extensions/active/decorators/base.js +19 -0
- package/dist/impl/extensions/active/decorators/configuration/index.js +20 -0
- package/dist/impl/extensions/active/decorators/index.js +3 -0
- package/dist/impl/extensions/active/decorators/moduleLoader/index.js +29 -0
- package/dist/impl/extensions/active/decorators/views/index.js +34 -0
- package/dist/impl/extensions/active/getter/index.js +28 -0
- package/dist/impl/extensions/active/index.js +14 -0
- package/dist/impl/extensions/analysis/decorators/activationEvents/commands/base.js +2 -0
- package/dist/impl/extensions/analysis/decorators/activationEvents/commands/index.js +2 -0
- package/dist/impl/extensions/analysis/decorators/activationEvents/commands/onCommand.js +16 -0
- package/dist/impl/extensions/analysis/decorators/activationEvents/commands/onExtension.js +16 -0
- package/dist/impl/extensions/analysis/decorators/activationEvents/handler/index.js +32 -0
- package/dist/impl/extensions/analysis/decorators/activationEvents/index.js +29 -0
- package/dist/impl/extensions/analysis/decorators/base.js +19 -0
- package/dist/impl/extensions/analysis/decorators/commands/index.js +37 -0
- package/dist/impl/extensions/analysis/decorators/index.js +4 -0
- package/dist/impl/extensions/analysis/decorators/keybindings/index.js +65 -0
- package/dist/impl/extensions/analysis/decorators/menus/index.js +20 -0
- package/dist/impl/extensions/analysis/index.js +15 -0
- package/dist/impl/extensions/analysis/reader/index.js +31 -0
- package/dist/impl/extensions/index.js +76 -0
- package/dist/impl/history/index.js +57 -0
- package/dist/impl/index.js +6 -4
- package/dist/impl/keyboardShortcuts/index.js +67 -0
- package/dist/impl/layout/index.js +50 -0
- package/dist/impl/statusbar/index.js +81 -0
- package/dist/impl/timeServer/index.js +49 -0
- package/dist/index.js +8 -6
- package/package.json +8 -24
- package/types/index.d.ts +4 -13
- package/types/punica.module.activityBar.d.ts +21 -0
- package/types/punica.module.commands.d.ts +10 -7
- package/types/punica.module.extensions.d.ts +122 -4
- package/types/punica.module.history.d.ts +18 -0
- package/types/punica.module.keyboardShortcuts.d.ts +6 -1
- package/types/punica.module.statusbar.d.ts +6 -5
- package/types/punica.module.view.d.ts +1 -1
- package/types/punica.types.d.ts +11 -0
- package/dist/impl/commands.js +0 -72
- package/dist/impl/dragDrop.js +0 -119
- package/dist/impl/extensions.js +0 -45
- package/dist/impl/keyboardShortcuts.js +0 -67
- package/dist/impl/layout.js +0 -59
- package/dist/impl/statusbar.js +0 -75
- package/dist/impl/timeServer.js +0 -57
- /package/dist/impl/{view.js → view/index.js} +0 -0
package/dist/impl/commands.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _CommandManager_commandMap, _CommandManager_history, _CommandManager_undone;
|
|
13
|
-
class CommandManager {
|
|
14
|
-
constructor() {
|
|
15
|
-
_CommandManager_commandMap.set(this, new Map());
|
|
16
|
-
_CommandManager_history.set(this, []);
|
|
17
|
-
_CommandManager_undone.set(this, []);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param command
|
|
22
|
-
*/
|
|
23
|
-
registerCommand(command) {
|
|
24
|
-
__classPrivateFieldGet(this, _CommandManager_commandMap, "f").set(command.id, command);
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
*
|
|
28
|
-
* @param commandId
|
|
29
|
-
*/
|
|
30
|
-
executeCommand(commandId) {
|
|
31
|
-
const command = __classPrivateFieldGet(this, _CommandManager_commandMap, "f").get(commandId);
|
|
32
|
-
if (command) {
|
|
33
|
-
command.execute();
|
|
34
|
-
__classPrivateFieldGet(this, _CommandManager_history, "f").push(command);
|
|
35
|
-
__classPrivateFieldSet(this, _CommandManager_undone, [], "f");
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
console.error(`Command with ID ${commandId} not found.`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
44
|
-
undo() {
|
|
45
|
-
const command = __classPrivateFieldGet(this, _CommandManager_history, "f").pop();
|
|
46
|
-
if (command) {
|
|
47
|
-
command.undo();
|
|
48
|
-
__classPrivateFieldGet(this, _CommandManager_undone, "f").push(command);
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
console.error('No command to undo.');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
redo() {
|
|
58
|
-
const command = __classPrivateFieldGet(this, _CommandManager_undone, "f").pop();
|
|
59
|
-
if (command) {
|
|
60
|
-
command.execute();
|
|
61
|
-
__classPrivateFieldGet(this, _CommandManager_history, "f").push(command);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
console.error('No command to redo.');
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
_CommandManager_commandMap = new WeakMap(), _CommandManager_history = new WeakMap(), _CommandManager_undone = new WeakMap();
|
|
69
|
-
const commands = {
|
|
70
|
-
manager: new CommandManager()
|
|
71
|
-
};
|
|
72
|
-
export default commands;
|
package/dist/impl/dragDrop.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _ServiceDragDrop_element, _ServiceDragDrop_events, _ServiceDragDrop_position;
|
|
13
|
-
import { BaseListener } from '@punica/common';
|
|
14
|
-
const calculateMutation = (point1, point2) => {
|
|
15
|
-
if (!point1 || !point2) {
|
|
16
|
-
return undefined;
|
|
17
|
-
}
|
|
18
|
-
return {
|
|
19
|
-
x: point2.x - point1.x,
|
|
20
|
-
y: point2.y - point1.y
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
const isTouchDevice = () => {
|
|
24
|
-
return 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
25
|
-
};
|
|
26
|
-
const eventType = () => {
|
|
27
|
-
const touch = isTouchDevice();
|
|
28
|
-
return {
|
|
29
|
-
dragStart: touch ? 'touchstart' : 'mousedown',
|
|
30
|
-
dragging: touch ? 'touchmove' : 'mousemove',
|
|
31
|
-
dragStop: touch ? 'touchend' : 'mouseup'
|
|
32
|
-
};
|
|
33
|
-
};
|
|
34
|
-
const setEventPosition = (event) => {
|
|
35
|
-
return {
|
|
36
|
-
offsetX: event.offsetX,
|
|
37
|
-
offsetY: event.offsetY,
|
|
38
|
-
pageX: event.pageX,
|
|
39
|
-
pageY: event.pageY,
|
|
40
|
-
clientX: event.clientX,
|
|
41
|
-
clientY: event.clientY
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
const getTranslate = (transform) => {
|
|
45
|
-
const detail = transform.match(/([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/);
|
|
46
|
-
const x = detail[1];
|
|
47
|
-
const y = detail[2];
|
|
48
|
-
return { x: parseFloat(x), y: parseFloat(y) };
|
|
49
|
-
};
|
|
50
|
-
class ServiceDragDrop extends BaseListener {
|
|
51
|
-
/**
|
|
52
|
-
*
|
|
53
|
-
* @param element
|
|
54
|
-
*/
|
|
55
|
-
constructor(element) {
|
|
56
|
-
super();
|
|
57
|
-
_ServiceDragDrop_element.set(this, void 0);
|
|
58
|
-
_ServiceDragDrop_events.set(this, void 0);
|
|
59
|
-
_ServiceDragDrop_position.set(this, void 0);
|
|
60
|
-
/**
|
|
61
|
-
*
|
|
62
|
-
* @param event
|
|
63
|
-
*/
|
|
64
|
-
this.handleDragStart = (event) => {
|
|
65
|
-
const eventPosition = setEventPosition(event);
|
|
66
|
-
__classPrivateFieldSet(this, _ServiceDragDrop_position, {
|
|
67
|
-
x: eventPosition.clientX,
|
|
68
|
-
y: eventPosition.clientY
|
|
69
|
-
}, "f");
|
|
70
|
-
__classPrivateFieldGet(this, _ServiceDragDrop_element, "f").addEventListener(__classPrivateFieldGet(this, _ServiceDragDrop_events, "f").dragging, this.handleDragging);
|
|
71
|
-
__classPrivateFieldGet(this, _ServiceDragDrop_element, "f").addEventListener(__classPrivateFieldGet(this, _ServiceDragDrop_events, "f").dragStop, this.handleDragStop);
|
|
72
|
-
this.trigger('dragStart', {
|
|
73
|
-
startPosition: __classPrivateFieldGet(this, _ServiceDragDrop_position, "f"),
|
|
74
|
-
position: eventPosition,
|
|
75
|
-
mutation: null
|
|
76
|
-
});
|
|
77
|
-
event.stopPropagation();
|
|
78
|
-
};
|
|
79
|
-
/**
|
|
80
|
-
*
|
|
81
|
-
* @param event
|
|
82
|
-
*/
|
|
83
|
-
this.handleDragging = (event) => {
|
|
84
|
-
const eventPosition = setEventPosition(event);
|
|
85
|
-
const mutation = calculateMutation(__classPrivateFieldGet(this, _ServiceDragDrop_position, "f"), {
|
|
86
|
-
x: eventPosition.clientX,
|
|
87
|
-
y: eventPosition.clientY
|
|
88
|
-
});
|
|
89
|
-
this.trigger('dragging', {
|
|
90
|
-
startPosition: __classPrivateFieldGet(this, _ServiceDragDrop_position, "f"),
|
|
91
|
-
position: eventPosition,
|
|
92
|
-
mutation
|
|
93
|
-
});
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
*
|
|
97
|
-
* @param event
|
|
98
|
-
*/
|
|
99
|
-
this.handleDragStop = (event) => {
|
|
100
|
-
const eventPosition = setEventPosition(event);
|
|
101
|
-
const mutation = calculateMutation(__classPrivateFieldGet(this, _ServiceDragDrop_position, "f"), {
|
|
102
|
-
x: eventPosition.clientX,
|
|
103
|
-
y: eventPosition.clientY
|
|
104
|
-
});
|
|
105
|
-
this.trigger('dragStop', {
|
|
106
|
-
startPosition: __classPrivateFieldGet(this, _ServiceDragDrop_position, "f"),
|
|
107
|
-
position: eventPosition,
|
|
108
|
-
mutation
|
|
109
|
-
});
|
|
110
|
-
__classPrivateFieldGet(this, _ServiceDragDrop_element, "f").removeEventListener(__classPrivateFieldGet(this, _ServiceDragDrop_events, "f").dragging, this.handleDragging);
|
|
111
|
-
__classPrivateFieldGet(this, _ServiceDragDrop_element, "f").removeEventListener(__classPrivateFieldGet(this, _ServiceDragDrop_events, "f").dragStop, this.handleDragStop);
|
|
112
|
-
};
|
|
113
|
-
__classPrivateFieldSet(this, _ServiceDragDrop_element, element, "f");
|
|
114
|
-
__classPrivateFieldSet(this, _ServiceDragDrop_events, eventType(), "f");
|
|
115
|
-
__classPrivateFieldGet(this, _ServiceDragDrop_element, "f").addEventListener(__classPrivateFieldGet(this, _ServiceDragDrop_events, "f").dragStart, this.handleDragStart);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
_ServiceDragDrop_element = new WeakMap(), _ServiceDragDrop_events = new WeakMap(), _ServiceDragDrop_position = new WeakMap();
|
|
119
|
-
export { ServiceDragDrop, calculateMutation, isTouchDevice, eventType, setEventPosition, getTranslate };
|
package/dist/impl/extensions.js
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _ExtensionManager_extensions;
|
|
13
|
-
class ExtensionManager {
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
constructor() {
|
|
18
|
-
_ExtensionManager_extensions.set(this, void 0);
|
|
19
|
-
__classPrivateFieldSet(this, _ExtensionManager_extensions, new Map(), "f");
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
* @param extension
|
|
24
|
-
*/
|
|
25
|
-
load(extension) {
|
|
26
|
-
if (__classPrivateFieldGet(this, _ExtensionManager_extensions, "f").has(extension.name)) {
|
|
27
|
-
console.warn(`Extension '${extension.name}' is already loaded.`);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
__classPrivateFieldGet(this, _ExtensionManager_extensions, "f").set(extension.name, extension);
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
*
|
|
34
|
-
* @param extensionName
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
getExtension(extensionName) {
|
|
38
|
-
return __classPrivateFieldGet(this, _ExtensionManager_extensions, "f").get(extensionName);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
_ExtensionManager_extensions = new WeakMap();
|
|
42
|
-
const extension = {
|
|
43
|
-
manager: new ExtensionManager()
|
|
44
|
-
};
|
|
45
|
-
export default extension;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _ShortcutManager_instances, _ShortcutManager_shortcuts, _ShortcutManager_areKeysEqual, _ShortcutManager_areKeysPressed;
|
|
13
|
-
class ShortcutManager {
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
constructor() {
|
|
18
|
-
_ShortcutManager_instances.add(this);
|
|
19
|
-
_ShortcutManager_shortcuts.set(this, []);
|
|
20
|
-
document.addEventListener('keydown', this.handleKeyEvent.bind(this));
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param shortcut
|
|
25
|
-
*/
|
|
26
|
-
registerShortcut(shortcut) {
|
|
27
|
-
__classPrivateFieldGet(this, _ShortcutManager_shortcuts, "f").push(shortcut);
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param keys
|
|
32
|
-
*/
|
|
33
|
-
unregisterShortcut(keys) {
|
|
34
|
-
__classPrivateFieldSet(this, _ShortcutManager_shortcuts, __classPrivateFieldGet(this, _ShortcutManager_shortcuts, "f").filter((shortcut) => __classPrivateFieldGet(this, _ShortcutManager_instances, "m", _ShortcutManager_areKeysEqual).call(this, shortcut.keys, keys)), "f");
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @param event
|
|
39
|
-
*/
|
|
40
|
-
handleKeyEvent(event) {
|
|
41
|
-
const matchedShortcut = __classPrivateFieldGet(this, _ShortcutManager_shortcuts, "f").find((shortcut) => __classPrivateFieldGet(this, _ShortcutManager_instances, "m", _ShortcutManager_areKeysPressed).call(this, event, shortcut.keys));
|
|
42
|
-
if (matchedShortcut) {
|
|
43
|
-
event.preventDefault();
|
|
44
|
-
const commandsManager = window.punica.Commands.manager;
|
|
45
|
-
commandsManager.executeCommand(matchedShortcut.commandId);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
_ShortcutManager_shortcuts = new WeakMap(), _ShortcutManager_instances = new WeakSet(), _ShortcutManager_areKeysEqual = function _ShortcutManager_areKeysEqual(keys1, keys2) {
|
|
50
|
-
if (keys1.length !== keys2.length)
|
|
51
|
-
return false;
|
|
52
|
-
return keys1.every((key1, index) => key1.key.toLowerCase() === keys2[index].key.toLowerCase() &&
|
|
53
|
-
key1.ctrlKey === keys2[index].ctrlKey &&
|
|
54
|
-
key1.shiftKey === keys2[index].shiftKey &&
|
|
55
|
-
key1.altKey === keys2[index].altKey &&
|
|
56
|
-
key1.metaKey === keys2[index].metaKey);
|
|
57
|
-
}, _ShortcutManager_areKeysPressed = function _ShortcutManager_areKeysPressed(event, keys) {
|
|
58
|
-
return keys.every((key) => (key.ctrlKey ? event.ctrlKey : true) &&
|
|
59
|
-
(key.shiftKey ? event.shiftKey : true) &&
|
|
60
|
-
(key.altKey ? event.altKey : true) &&
|
|
61
|
-
(key.metaKey ? event.metaKey : true) &&
|
|
62
|
-
event.key.toLowerCase() === key.key.toLowerCase());
|
|
63
|
-
};
|
|
64
|
-
const keyboardShortcuts = {
|
|
65
|
-
manager: new ShortcutManager()
|
|
66
|
-
};
|
|
67
|
-
export default keyboardShortcuts;
|
package/dist/impl/layout.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _LayoutManager_item, _LayoutManager_layoutElement;
|
|
13
|
-
class LayoutManager {
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
constructor() {
|
|
18
|
-
_LayoutManager_item.set(this, new Map());
|
|
19
|
-
_LayoutManager_layoutElement.set(this, void 0);
|
|
20
|
-
__classPrivateFieldSet(this, _LayoutManager_layoutElement, document.createElement('div'), "f");
|
|
21
|
-
__classPrivateFieldGet(this, _LayoutManager_layoutElement, "f").id = 'punica-editor';
|
|
22
|
-
this.addItem('appBar');
|
|
23
|
-
this.addItem('activityBar');
|
|
24
|
-
this.addItem('content');
|
|
25
|
-
this.addItem('statusbar');
|
|
26
|
-
this.addItem('primarySidebar');
|
|
27
|
-
this.addItem('secondarySidebar');
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param type
|
|
32
|
-
* @returns
|
|
33
|
-
*/
|
|
34
|
-
getItem(type) {
|
|
35
|
-
return __classPrivateFieldGet(this, _LayoutManager_item, "f").get(type);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param type
|
|
40
|
-
*/
|
|
41
|
-
addItem(type) {
|
|
42
|
-
const content = document.createElement('div');
|
|
43
|
-
content.id = type;
|
|
44
|
-
__classPrivateFieldGet(this, _LayoutManager_layoutElement, "f").appendChild(content);
|
|
45
|
-
__classPrivateFieldGet(this, _LayoutManager_item, "f").set(type, { type, content });
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
*
|
|
49
|
-
* @param container
|
|
50
|
-
*/
|
|
51
|
-
render(container) {
|
|
52
|
-
container.appendChild(__classPrivateFieldGet(this, _LayoutManager_layoutElement, "f"));
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
_LayoutManager_item = new WeakMap(), _LayoutManager_layoutElement = new WeakMap();
|
|
56
|
-
const layout = {
|
|
57
|
-
manager: new LayoutManager()
|
|
58
|
-
};
|
|
59
|
-
export default layout;
|
package/dist/impl/statusbar.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
2
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
3
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
4
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
5
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
6
|
-
};
|
|
7
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
11
|
-
};
|
|
12
|
-
var _StatusbarManager_instances, _StatusbarManager_leftItems, _StatusbarManager_rightItems, _StatusbarManager_content, _StatusbarManager_leftContent, _StatusbarManager_rightContent, _StatusbarManager_initiliazeContent;
|
|
13
|
-
class StatusbarManager {
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
constructor() {
|
|
18
|
-
_StatusbarManager_instances.add(this);
|
|
19
|
-
_StatusbarManager_leftItems.set(this, new Map());
|
|
20
|
-
_StatusbarManager_rightItems.set(this, new Map());
|
|
21
|
-
_StatusbarManager_content.set(this, void 0);
|
|
22
|
-
_StatusbarManager_leftContent.set(this, void 0);
|
|
23
|
-
_StatusbarManager_rightContent.set(this, void 0);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param alignment
|
|
28
|
-
* @param item
|
|
29
|
-
*/
|
|
30
|
-
addItem(alignment, item) {
|
|
31
|
-
if (!__classPrivateFieldGet(this, _StatusbarManager_content, "f")) {
|
|
32
|
-
__classPrivateFieldGet(this, _StatusbarManager_instances, "m", _StatusbarManager_initiliazeContent).call(this);
|
|
33
|
-
}
|
|
34
|
-
if (alignment === 'left') {
|
|
35
|
-
__classPrivateFieldGet(this, _StatusbarManager_leftItems, "f").set(item.id, item);
|
|
36
|
-
__classPrivateFieldGet(this, _StatusbarManager_leftContent, "f").appendChild(item.content);
|
|
37
|
-
}
|
|
38
|
-
else {
|
|
39
|
-
__classPrivateFieldGet(this, _StatusbarManager_rightItems, "f").set(item.id, item);
|
|
40
|
-
__classPrivateFieldGet(this, _StatusbarManager_rightContent, "f").appendChild(item.content);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
*
|
|
45
|
-
* @param itemId
|
|
46
|
-
*/
|
|
47
|
-
removeItem(itemId) {
|
|
48
|
-
if (__classPrivateFieldGet(this, _StatusbarManager_leftItems, "f").has(itemId)) {
|
|
49
|
-
const item = __classPrivateFieldGet(this, _StatusbarManager_leftItems, "f").get(itemId);
|
|
50
|
-
__classPrivateFieldGet(this, _StatusbarManager_leftItems, "f").delete(itemId);
|
|
51
|
-
__classPrivateFieldGet(this, _StatusbarManager_leftContent, "f").removeChild(item.content);
|
|
52
|
-
}
|
|
53
|
-
else if (__classPrivateFieldGet(this, _StatusbarManager_rightItems, "f").has(itemId)) {
|
|
54
|
-
const item = __classPrivateFieldGet(this, _StatusbarManager_rightItems, "f").get(itemId);
|
|
55
|
-
__classPrivateFieldGet(this, _StatusbarManager_rightItems, "f").delete(itemId);
|
|
56
|
-
__classPrivateFieldGet(this, _StatusbarManager_rightContent, "f").removeChild(item.content);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
_StatusbarManager_leftItems = new WeakMap(), _StatusbarManager_rightItems = new WeakMap(), _StatusbarManager_content = new WeakMap(), _StatusbarManager_leftContent = new WeakMap(), _StatusbarManager_rightContent = new WeakMap(), _StatusbarManager_instances = new WeakSet(), _StatusbarManager_initiliazeContent = function _StatusbarManager_initiliazeContent() {
|
|
61
|
-
const layoutManager = window.punica.Layout.manager;
|
|
62
|
-
const statusBarContent = layoutManager.getItem('statusbar').content;
|
|
63
|
-
__classPrivateFieldSet(this, _StatusbarManager_content, document.createElement('punica-row'), "f");
|
|
64
|
-
__classPrivateFieldSet(this, _StatusbarManager_leftContent, document.createElement('punica-col'), "f");
|
|
65
|
-
__classPrivateFieldSet(this, _StatusbarManager_rightContent, document.createElement('punica-col'), "f");
|
|
66
|
-
__classPrivateFieldGet(this, _StatusbarManager_content, "f").setAttribute('alignItems', 'center');
|
|
67
|
-
__classPrivateFieldGet(this, _StatusbarManager_content, "f").setAttribute('justifyContent', 'space-between');
|
|
68
|
-
__classPrivateFieldGet(this, _StatusbarManager_content, "f").appendChild(__classPrivateFieldGet(this, _StatusbarManager_leftContent, "f"));
|
|
69
|
-
__classPrivateFieldGet(this, _StatusbarManager_content, "f").appendChild(__classPrivateFieldGet(this, _StatusbarManager_rightContent, "f"));
|
|
70
|
-
statusBarContent === null || statusBarContent === void 0 ? void 0 : statusBarContent.appendChild(__classPrivateFieldGet(this, _StatusbarManager_content, "f"));
|
|
71
|
-
};
|
|
72
|
-
const statusbar = {
|
|
73
|
-
manager: new StatusbarManager()
|
|
74
|
-
};
|
|
75
|
-
export default statusbar;
|
package/dist/impl/timeServer.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
-
};
|
|
12
|
-
var _TimeServerManager_instances, _TimeServerManager_subscribers, _TimeServerManager_intervalId, _TimeServerManager_start, _TimeServerManager_stop;
|
|
13
|
-
class TimeServerManager {
|
|
14
|
-
constructor() {
|
|
15
|
-
_TimeServerManager_instances.add(this);
|
|
16
|
-
_TimeServerManager_subscribers.set(this, []);
|
|
17
|
-
_TimeServerManager_intervalId.set(this, null);
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @param subscriber
|
|
22
|
-
*/
|
|
23
|
-
subscribe(subscriber) {
|
|
24
|
-
__classPrivateFieldGet(this, _TimeServerManager_subscribers, "f").push(subscriber);
|
|
25
|
-
if (__classPrivateFieldGet(this, _TimeServerManager_subscribers, "f").length == 1) {
|
|
26
|
-
__classPrivateFieldGet(this, _TimeServerManager_instances, "m", _TimeServerManager_start).call(this);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
* @param subscriber
|
|
32
|
-
*/
|
|
33
|
-
unsubscribe(subscriber) {
|
|
34
|
-
__classPrivateFieldSet(this, _TimeServerManager_subscribers, __classPrivateFieldGet(this, _TimeServerManager_subscribers, "f").filter((sub) => sub !== subscriber), "f");
|
|
35
|
-
if (__classPrivateFieldGet(this, _TimeServerManager_subscribers, "f").length == 0) {
|
|
36
|
-
__classPrivateFieldGet(this, _TimeServerManager_instances, "m", _TimeServerManager_stop).call(this);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
_TimeServerManager_subscribers = new WeakMap(), _TimeServerManager_intervalId = new WeakMap(), _TimeServerManager_instances = new WeakSet(), _TimeServerManager_start = function _TimeServerManager_start() {
|
|
41
|
-
if (__classPrivateFieldGet(this, _TimeServerManager_intervalId, "f") === null) {
|
|
42
|
-
__classPrivateFieldSet(this, _TimeServerManager_intervalId, window.setInterval(() => {
|
|
43
|
-
const currentTime = new Date();
|
|
44
|
-
__classPrivateFieldGet(this, _TimeServerManager_subscribers, "f").forEach((subscriber) => subscriber.update(currentTime));
|
|
45
|
-
}, 1000), "f");
|
|
46
|
-
}
|
|
47
|
-
}, _TimeServerManager_stop = function _TimeServerManager_stop() {
|
|
48
|
-
if (__classPrivateFieldGet(this, _TimeServerManager_intervalId, "f") !== null) {
|
|
49
|
-
window.clearInterval(__classPrivateFieldGet(this, _TimeServerManager_intervalId, "f"));
|
|
50
|
-
__classPrivateFieldSet(this, _TimeServerManager_intervalId, null, "f");
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
const timeServerManager = {
|
|
54
|
-
manager: new TimeServerManager()
|
|
55
|
-
};
|
|
56
|
-
//timeServerManager.manager.start();
|
|
57
|
-
export default timeServerManager;
|
|
File without changes
|