@openremote/or-rules 1.8.0-snapshot.20250725074716 → 1.8.0-snapshot.20250725120000

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.
Files changed (73) hide show
  1. package/README.md +30 -30
  2. package/custom-elements.json +13 -13
  3. package/dist/umd/index.bundle.js +4744 -4744
  4. package/dist/umd/index.bundle.js.map +1 -1
  5. package/lib/flow-viewer/components/confirmation-dialog.js +61 -24
  6. package/lib/flow-viewer/components/connection-container.js +35 -1
  7. package/lib/flow-viewer/components/connection-line.js +117 -28
  8. package/lib/flow-viewer/components/context-menu.js +140 -45
  9. package/lib/flow-viewer/components/editor-workspace.js +282 -20
  10. package/lib/flow-viewer/components/flow-editor.js +160 -47
  11. package/lib/flow-viewer/components/flow-node-socket.js +146 -31
  12. package/lib/flow-viewer/components/flow-node.js +192 -29
  13. package/lib/flow-viewer/components/internal-picker.js +271 -54
  14. package/lib/flow-viewer/components/node-menu-item.js +132 -32
  15. package/lib/flow-viewer/components/node-panel.js +104 -60
  16. package/lib/flow-viewer/components/notification-dialog.js +55 -23
  17. package/lib/flow-viewer/components/popup-modal.js +113 -54
  18. package/lib/flow-viewer/components/rule-browser.js +119 -30
  19. package/lib/flow-viewer/components/selectable-element.js +71 -1
  20. package/lib/flow-viewer/components/selection-box.js +119 -15
  21. package/lib/flow-viewer/components/top-bar.js +116 -49
  22. package/lib/flow-viewer/components/workspace-contextmenu-options.js +128 -5
  23. package/lib/flow-viewer/components/writable-dropdown.js +51 -5
  24. package/lib/flow-viewer/converters/node-converter.js +10 -1
  25. package/lib/flow-viewer/flow-viewer.js +19 -1
  26. package/lib/flow-viewer/models/camera.js +2 -1
  27. package/lib/flow-viewer/models/context-menu-button.js +2 -1
  28. package/lib/flow-viewer/models/light-node-collection.js +2 -1
  29. package/lib/flow-viewer/models/status.js +8 -1
  30. package/lib/flow-viewer/node-structure/copy.machine.js +34 -1
  31. package/lib/flow-viewer/node-structure/identity.assigner.js +10 -1
  32. package/lib/flow-viewer/node-structure/identity.dom.link.js +4 -1
  33. package/lib/flow-viewer/node-structure/index.js +5 -1
  34. package/lib/flow-viewer/node-structure/socket.type.matcher.js +50 -1
  35. package/lib/flow-viewer/node-structure/utils.js +109 -1
  36. package/lib/flow-viewer/services/copy-paste-manager.js +59 -1
  37. package/lib/flow-viewer/services/exporter.js +67 -1
  38. package/lib/flow-viewer/services/input.js +80 -1
  39. package/lib/flow-viewer/services/integration.js +27 -1
  40. package/lib/flow-viewer/services/modal.js +29 -8
  41. package/lib/flow-viewer/services/project.js +222 -1
  42. package/lib/flow-viewer/services/shortcuts.js +63 -1
  43. package/lib/flow-viewer/styles/editor-workspace-style.js +55 -53
  44. package/lib/flow-viewer/styles/flow-node-style.js +95 -93
  45. package/lib/flow-viewer/styles/picker-styles.js +31 -29
  46. package/lib/flow-viewer/utils.js +49 -1
  47. package/lib/index.js +953 -56
  48. package/lib/json-viewer/forms/or-rule-form-alarm.js +91 -18
  49. package/lib/json-viewer/forms/or-rule-form-email-message.js +51 -12
  50. package/lib/json-viewer/forms/or-rule-form-localized.js +269 -43
  51. package/lib/json-viewer/forms/or-rule-form-push-notification.js +152 -63
  52. package/lib/json-viewer/forms/or-rule-form-webhook.js +296 -101
  53. package/lib/json-viewer/modals/or-rule-alarm-modal.js +173 -17
  54. package/lib/json-viewer/modals/or-rule-notification-modal.js +196 -11
  55. package/lib/json-viewer/modals/or-rule-radial-modal.js +142 -17
  56. package/lib/json-viewer/modals/or-rule-webhook-modal.js +78 -8
  57. package/lib/json-viewer/or-rule-action-alarm.js +97 -5
  58. package/lib/json-viewer/or-rule-action-attribute.js +235 -33
  59. package/lib/json-viewer/or-rule-action-notification.js +465 -56
  60. package/lib/json-viewer/or-rule-action-webhook.js +49 -18
  61. package/lib/json-viewer/or-rule-asset-query.js +849 -126
  62. package/lib/json-viewer/or-rule-condition.js +216 -29
  63. package/lib/json-viewer/or-rule-json-viewer.js +393 -34
  64. package/lib/json-viewer/or-rule-then-otherwise.js +609 -113
  65. package/lib/json-viewer/or-rule-trigger-query.js +227 -57
  66. package/lib/json-viewer/or-rule-when.js +343 -126
  67. package/lib/or-rule-group-viewer.js +106 -12
  68. package/lib/or-rule-text-viewer.js +133 -22
  69. package/lib/or-rule-tree.js +601 -57
  70. package/lib/or-rule-validity.js +373 -62
  71. package/lib/or-rule-viewer.js +361 -81
  72. package/lib/style.js +89 -64
  73. package/package.json +11 -11
@@ -1 +1,222 @@
1
- var __awaiter=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))(function(o,s){function h(t){try{c(n.next(t))}catch(t){s(t)}}function r(t){try{c(n.throw(t))}catch(t){s(t)}}function c(t){var e;t.done?o(t.value):((e=t.value)instanceof i?e:new i(function(t){t(e)})).then(h,r)}c((n=n.apply(t,e||[])).next())})};import{EventEmitter as t}from"events";import{input as e}from"../components/flow-editor";import{NodeUtilities as i}from"../node-structure";import{SocketTypeMatcher as n}from"../node-structure/socket.type.matcher";export class Project extends t{constructor(){super(),this.nodes=[],this.connections=[],this.existingFlowRuleId=-1,this.existingFlowRuleName=null,this.existingFlowRuleDesc=null,this.isInUnsavedState=!1,this.isConnecting=!1,this.history=[],this.historyIndex=0,this.startConnectionDrag=(t,e,i)=>{this.connectionStartSocket=null,this.connectionEndSocket=null,i?this.connectionEndSocket=e:this.connectionStartSocket=e,this.isConnecting=!0,this.emit("connectionstart",t,e)},this.connectionDragging=t=>{this.emit("connecting",t)},this.endConnectionDrag=(t,e,i)=>{this.isConnecting&&(i?this.connectionEndSocket=e:this.connectionStartSocket=e,this.isConnecting=!1,this.emit("connectionend",t,e),this.connectionEndSocket&&this.connectionStartSocket&&this.createConnection(this.connectionStartSocket.id,this.connectionEndSocket.id))},this.setMaxListeners(1024)}get isCurrentlyConnecting(){return this.isConnecting}set unsavedState(t){this.isInUnsavedState=t,this.emit("unsavedstateset",t)}get unsavedState(){return this.isInUnsavedState}setCurrentProject(t,e,i){this.unsavedState=!1,this.existingFlowRuleId=t,this.existingFlowRuleName=e,this.existingFlowRuleDesc=i,this.history=[],this.emit("projectset",t)}notifyChange(){this.unsavedState=!0,this.emit("changed")}createUndoSnapshot(){this.history=this.history.splice(0,this.historyIndex+1),this.history.push(JSON.parse(JSON.stringify(this.toNodeCollection("","")))),this.historyIndex=this.history.length-1}undo(){return __awaiter(this,void 0,void 0,function*(){0!==this.history.length&&-1!==this.historyIndex&&(this.historyIndex===this.history.length-1&&this.history.push(JSON.parse(JSON.stringify(this.toNodeCollection("","")))),yield this.fromNodeCollection(this.history[this.historyIndex]),this.historyIndex--,this.notifyChange())})}redo(){return __awaiter(this,void 0,void 0,function*(){0===this.history.length||this.historyIndex>=this.history.length-2||(this.historyIndex++,yield this.fromNodeCollection(this.history[this.historyIndex+1]),this.notifyChange())})}fromNodeCollection(t){return __awaiter(this,void 0,void 0,function*(){yield this.clear(),t.nodes.forEach(t=>{this.addNode(t)}),t.connections.forEach(t=>{this.createConnection(t.from,t.to)}),this.emit("nodecollectionloaded",t),this.unsavedState=!1})}toNodeCollection(t,e){return{name:t,description:e,connections:this.connections,nodes:this.nodes}}clear(){return __awaiter(this,arguments,void 0,function*(t=!1){e.clearSelection(),this.nodes.forEach(t=>{this.removeNode(t)}),this.nodes=[],this.connections=[],this.unsavedState=!t,t&&this.setCurrentProject(-1,null,null),this.emit("cleared")})}addNode(t){if(this.nodes.filter(e=>e.id===t.id).length>0)throw Error("Node with identical identity already exists in the project");this.nodes.push(t),this.emit("nodeadded",t)}removeNode(t){e.clearSelection(),this.connections.filter(e=>{let n=i.getSocketFromID(e.from,this.nodes),o=i.getSocketFromID(e.to,this.nodes);return n.nodeId===t.id||o.nodeId===t.id}).forEach(t=>{this.removeConnection(t)}),this.nodes.filter(e=>e.id===t.id).forEach(t=>{this.nodes.splice(this.nodes.indexOf(t),1),this.emit("noderemoved",t)})}removeConnection(t){e.clearSelection(),this.connections.filter(e=>e.from===t.from&&e.to===t.to).forEach(t=>{let e=this.connections.indexOf(t);-1===e?console.warn("attempt to delete nonexistent connection"):(this.connections.splice(e,1),this.emit("connectionremoved",t))})}isValidConnection(t){let e=i.getSocketFromID(t.from,this.nodes),o=i.getSocketFromID(t.to,this.nodes);return!!e&&!!o&&!(!n.match(e.type,o.type)||e.id===o.id||e.nodeId===o.nodeId)}createConnection(t,e){let n={from:t,to:e};if(!this.isValidConnection(n))return!1;if(!i.getSocketFromID(n.to,this.nodes).type.includes("_ARRAY"))for(let t of this.connections.filter(t=>t.to===e))this.removeConnection(t);return this.connections.push(n),this.emit("connectioncreated",t,e),!0}removeInvalidConnections(){for(let t of this.connections.map(t=>this.enrichConnection(t)).filter(t=>!this.isValidConnection(t)))this.removeConnection(t)}enrichConnection(t){var e,n;return{from:null==(e=i.getSocketFromID(t.from,this.nodes))?void 0:e.id,to:null==(n=i.getSocketFromID(t.to,this.nodes))?void 0:n.id}}}
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import { EventEmitter } from "events";
11
+ import { input } from "../components/flow-editor";
12
+ import { NodeUtilities } from "../node-structure";
13
+ import { SocketTypeMatcher } from "../node-structure/socket.type.matcher";
14
+ export class Project extends EventEmitter {
15
+ constructor() {
16
+ super();
17
+ this.nodes = [];
18
+ this.connections = [];
19
+ this.existingFlowRuleId = -1;
20
+ this.existingFlowRuleName = null;
21
+ this.existingFlowRuleDesc = null;
22
+ this.isInUnsavedState = false;
23
+ this.isConnecting = false;
24
+ this.history = [];
25
+ this.historyIndex = 0;
26
+ this.startConnectionDrag = (e, socket, isInputNode) => {
27
+ this.connectionStartSocket = null;
28
+ this.connectionEndSocket = null;
29
+ if (isInputNode) {
30
+ this.connectionEndSocket = socket;
31
+ }
32
+ else {
33
+ this.connectionStartSocket = socket;
34
+ }
35
+ this.isConnecting = true;
36
+ this.emit("connectionstart", e, socket);
37
+ };
38
+ this.connectionDragging = (e) => {
39
+ this.emit("connecting", e);
40
+ };
41
+ this.endConnectionDrag = (e, socket, isInputNode) => {
42
+ if (!this.isConnecting) {
43
+ return;
44
+ }
45
+ if (isInputNode) {
46
+ this.connectionEndSocket = socket;
47
+ }
48
+ else {
49
+ this.connectionStartSocket = socket;
50
+ }
51
+ this.isConnecting = false;
52
+ this.emit("connectionend", e, socket);
53
+ if (this.connectionEndSocket && this.connectionStartSocket) {
54
+ this.createConnection(this.connectionStartSocket.id, this.connectionEndSocket.id);
55
+ }
56
+ };
57
+ this.setMaxListeners(1024);
58
+ }
59
+ get isCurrentlyConnecting() {
60
+ return this.isConnecting;
61
+ }
62
+ set unsavedState(state) {
63
+ this.isInUnsavedState = state;
64
+ this.emit("unsavedstateset", state);
65
+ }
66
+ get unsavedState() {
67
+ return this.isInUnsavedState;
68
+ }
69
+ setCurrentProject(id, name, desc) {
70
+ this.unsavedState = false;
71
+ this.existingFlowRuleId = id;
72
+ this.existingFlowRuleName = name;
73
+ this.existingFlowRuleDesc = desc;
74
+ this.history = [];
75
+ this.emit("projectset", id);
76
+ }
77
+ notifyChange() {
78
+ this.unsavedState = true;
79
+ this.emit("changed");
80
+ }
81
+ createUndoSnapshot() {
82
+ this.history = this.history.splice(0, this.historyIndex + 1);
83
+ this.history.push(JSON.parse(JSON.stringify(this.toNodeCollection("", ""))));
84
+ this.historyIndex = this.history.length - 1;
85
+ }
86
+ undo() {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ if (this.history.length === 0 || this.historyIndex === -1) {
89
+ return;
90
+ }
91
+ if (this.historyIndex === this.history.length - 1) {
92
+ this.history.push(JSON.parse(JSON.stringify(this.toNodeCollection("", ""))));
93
+ }
94
+ yield this.fromNodeCollection(this.history[this.historyIndex]);
95
+ this.historyIndex--;
96
+ this.notifyChange();
97
+ });
98
+ }
99
+ redo() {
100
+ return __awaiter(this, void 0, void 0, function* () {
101
+ if (this.history.length === 0 || this.historyIndex >= (this.history.length - 2)) {
102
+ return;
103
+ }
104
+ this.historyIndex++;
105
+ yield this.fromNodeCollection(this.history[this.historyIndex + 1]);
106
+ this.notifyChange();
107
+ });
108
+ }
109
+ fromNodeCollection(collection) {
110
+ return __awaiter(this, void 0, void 0, function* () {
111
+ yield this.clear();
112
+ collection.nodes.forEach((node) => {
113
+ this.addNode(node);
114
+ });
115
+ collection.connections.forEach((conn) => {
116
+ this.createConnection(conn.from, conn.to);
117
+ });
118
+ this.emit("nodecollectionloaded", collection);
119
+ this.unsavedState = false;
120
+ });
121
+ }
122
+ toNodeCollection(name, description) {
123
+ return {
124
+ name,
125
+ description,
126
+ connections: this.connections,
127
+ nodes: this.nodes
128
+ };
129
+ }
130
+ clear() {
131
+ return __awaiter(this, arguments, void 0, function* (alsoResetProject = false) {
132
+ input.clearSelection();
133
+ this.nodes.forEach((n) => {
134
+ this.removeNode(n);
135
+ });
136
+ this.nodes = [];
137
+ this.connections = [];
138
+ this.unsavedState = !alsoResetProject;
139
+ if (alsoResetProject) {
140
+ this.setCurrentProject(-1, null, null);
141
+ }
142
+ this.emit("cleared");
143
+ });
144
+ }
145
+ addNode(node) {
146
+ if (this.nodes.filter((n) => n.id === node.id).length > 0) {
147
+ throw new Error("Node with identical identity already exists in the project");
148
+ }
149
+ this.nodes.push(node);
150
+ this.emit("nodeadded", node);
151
+ }
152
+ removeNode(node) {
153
+ input.clearSelection();
154
+ this.connections.filter((c) => {
155
+ const from = NodeUtilities.getSocketFromID(c.from, this.nodes);
156
+ const to = NodeUtilities.getSocketFromID(c.to, this.nodes);
157
+ return from.nodeId === node.id || to.nodeId === node.id;
158
+ }).forEach((c) => {
159
+ this.removeConnection(c);
160
+ });
161
+ this.nodes.filter((n) => n.id === node.id).forEach((n) => {
162
+ this.nodes.splice(this.nodes.indexOf(n), 1);
163
+ this.emit("noderemoved", n);
164
+ });
165
+ }
166
+ removeConnection(connection) {
167
+ input.clearSelection();
168
+ this.connections.filter((c) => c.from === connection.from && c.to === connection.to).forEach((c) => {
169
+ const index = this.connections.indexOf(c);
170
+ if (index === -1) {
171
+ console.warn("attempt to delete nonexistent connection");
172
+ }
173
+ else {
174
+ this.connections.splice(index, 1);
175
+ this.emit("connectionremoved", c);
176
+ }
177
+ });
178
+ }
179
+ isValidConnection(connection) {
180
+ const fromSocket = NodeUtilities.getSocketFromID(connection.from, this.nodes);
181
+ const toSocket = NodeUtilities.getSocketFromID(connection.to, this.nodes);
182
+ if (!fromSocket ||
183
+ !toSocket) {
184
+ return false;
185
+ }
186
+ return !(!SocketTypeMatcher.match(fromSocket.type, toSocket.type) ||
187
+ fromSocket.id === toSocket.id ||
188
+ fromSocket.nodeId === toSocket.nodeId);
189
+ }
190
+ createConnection(fromSocket, toSocket) {
191
+ const connection = {
192
+ from: fromSocket,
193
+ to: toSocket
194
+ };
195
+ if (!(this.isValidConnection(connection))) {
196
+ return false;
197
+ }
198
+ // If the type contains _ARRAY, then assume that we allow multiple nodes to connect to that socket.
199
+ if (!((NodeUtilities.getSocketFromID(connection.to, this.nodes).type).includes("_ARRAY"))) {
200
+ for (const c of this.connections.filter((j) => j.to === toSocket)) {
201
+ // TODO: this.connections should contain the types of the other nodes, so that we only remove
202
+ this.removeConnection(c);
203
+ }
204
+ }
205
+ this.connections.push(connection);
206
+ this.emit("connectioncreated", fromSocket, toSocket);
207
+ return true;
208
+ }
209
+ removeInvalidConnections() {
210
+ for (const c of this.connections.map(c => this.enrichConnection(c)).filter(j => !this.isValidConnection(j))) {
211
+ this.removeConnection(c);
212
+ }
213
+ }
214
+ enrichConnection(c) {
215
+ var _a, _b;
216
+ return {
217
+ from: (_a = NodeUtilities.getSocketFromID(c.from, this.nodes)) === null || _a === void 0 ? void 0 : _a.id,
218
+ to: (_b = NodeUtilities.getSocketFromID(c.to, this.nodes)) === null || _b === void 0 ? void 0 : _b.id
219
+ };
220
+ }
221
+ }
222
+ //# sourceMappingURL=project.js.map
@@ -1 +1,63 @@
1
- import{FlowNode as e}from"../components/flow-node";import{ConnectionLine as o}from"../components/connection-line";import{input as t,project as n}from"../components/flow-editor";export class Shortcuts{constructor(){this.actions=[{keys:["Delete","Backspace"],action:()=>{n.createUndoSnapshot();let c=t.selected.filter(o=>o instanceof e&&o.selected&&!o.frozen);t.selected.filter(e=>e instanceof o&&e.selected).forEach(e=>n.removeConnection(e.connection)),c.forEach(e=>n.removeNode(e.node)),n.notifyChange()}},{keys:["KeyA"],requireCtrl:!0,action:()=>{t.selected.length>0?t.clearSelection(!0):t.selectables.forEach(e=>{t.select(e,!0)})}},{keys:["KeyZ"],requireCtrl:!0,action:()=>{n.undo()}},{keys:["KeyY"],requireCtrl:!0,action:()=>{n.redo()}}],window.addEventListener("keydown",e=>{document.activeElement instanceof HTMLBodyElement&&this.actions.forEach(o=>{(o.keys.includes(e.key)||o.keys.includes(e.code))&&(!o.requireCtrl||e.ctrlKey)&&o.action()})})}}
1
+ import { FlowNode } from "../components/flow-node";
2
+ import { ConnectionLine } from "../components/connection-line";
3
+ import { input, project } from "../components/flow-editor";
4
+ export class Shortcuts {
5
+ constructor() {
6
+ this.actions = [
7
+ {
8
+ keys: ["Delete", "Backspace"],
9
+ action: () => {
10
+ project.createUndoSnapshot();
11
+ const selectedNodes = input.selected.filter((s) => s instanceof FlowNode && s.selected && !s.frozen);
12
+ const selectedConnections = input.selected.filter((s) => s instanceof ConnectionLine && s.selected);
13
+ selectedConnections.forEach((n) => project.removeConnection(n.connection));
14
+ selectedNodes.forEach((n) => project.removeNode(n.node));
15
+ project.notifyChange();
16
+ }
17
+ },
18
+ {
19
+ keys: ["KeyA"],
20
+ requireCtrl: true,
21
+ action: () => {
22
+ if (input.selected.length > 0) {
23
+ input.clearSelection(true);
24
+ }
25
+ else {
26
+ input.selectables.forEach((s) => {
27
+ input.select(s, true);
28
+ });
29
+ }
30
+ }
31
+ },
32
+ {
33
+ keys: ["KeyZ"],
34
+ requireCtrl: true,
35
+ action: () => {
36
+ project.undo();
37
+ }
38
+ },
39
+ {
40
+ keys: ["KeyY"],
41
+ requireCtrl: true,
42
+ action: () => {
43
+ project.redo();
44
+ }
45
+ }
46
+ ];
47
+ window.addEventListener("keydown", (e) => {
48
+ if (!(document.activeElement instanceof HTMLBodyElement)) {
49
+ return;
50
+ }
51
+ this.actions.forEach((a) => {
52
+ if (!a.keys.includes(e.key) && !a.keys.includes(e.code)) {
53
+ return;
54
+ }
55
+ if (a.requireCtrl && !e.ctrlKey) {
56
+ return;
57
+ }
58
+ a.action();
59
+ });
60
+ });
61
+ }
62
+ }
63
+ //# sourceMappingURL=shortcuts.js.map
@@ -1,53 +1,55 @@
1
- import{css as o}from"lit";export const EditorWorkspaceStyle=o`
2
- :host{
3
- background: whitesmoke;
4
- position: relative;
5
- display: block;
6
- overflow: hidden;
7
- box-shadow: rgba(0, 0, 0, 0.2) 0 0 4px inset;
8
- height: 100%;
9
- }
10
-
11
- .view-options{
12
- position: absolute;
13
- left: 0;
14
- top: 0;
15
- display: flex;
16
- flex-direction: row;
17
- }
18
-
19
- .button{
20
- padding: 10px;
21
- margin: 10px;
22
- cursor:pointer;
23
- background: rgba(0,0,0,0.02);
24
- }
25
-
26
- or-mwc-input[type=button]
27
- {
28
- margin: 10px;
29
- color: inherit;
30
- }
31
-
32
- .button:hover{
33
- background: rgba(0,0,0,0.04);
34
- }
35
-
36
- .button:active{
37
- background: rgba(0,0,0,0.06);
38
- }
39
-
40
- svg, connection-container {
41
- pointer-events: none;
42
- position: absolute;
43
- display: block;
44
- right: 0;
45
- top: 0;
46
- left: 0;
47
- bottom: 0;
48
- width: 100%;
49
- height: 100%;
50
- stroke-width: 4px;
51
- stroke: rgb(80,80,80);
52
- }
53
- `;
1
+ import { css } from "lit";
2
+ export const EditorWorkspaceStyle = css `
3
+ :host{
4
+ background: whitesmoke;
5
+ position: relative;
6
+ display: block;
7
+ overflow: hidden;
8
+ box-shadow: rgba(0, 0, 0, 0.2) 0 0 4px inset;
9
+ height: 100%;
10
+ }
11
+
12
+ .view-options{
13
+ position: absolute;
14
+ left: 0;
15
+ top: 0;
16
+ display: flex;
17
+ flex-direction: row;
18
+ }
19
+
20
+ .button{
21
+ padding: 10px;
22
+ margin: 10px;
23
+ cursor:pointer;
24
+ background: rgba(0,0,0,0.02);
25
+ }
26
+
27
+ or-mwc-input[type=button]
28
+ {
29
+ margin: 10px;
30
+ color: inherit;
31
+ }
32
+
33
+ .button:hover{
34
+ background: rgba(0,0,0,0.04);
35
+ }
36
+
37
+ .button:active{
38
+ background: rgba(0,0,0,0.06);
39
+ }
40
+
41
+ svg, connection-container {
42
+ pointer-events: none;
43
+ position: absolute;
44
+ display: block;
45
+ right: 0;
46
+ top: 0;
47
+ left: 0;
48
+ bottom: 0;
49
+ width: 100%;
50
+ height: 100%;
51
+ stroke-width: 4px;
52
+ stroke: rgb(80,80,80);
53
+ }
54
+ `;
55
+ //# sourceMappingURL=editor-workspace-style.js.map
@@ -1,93 +1,95 @@
1
- import{css as t}from"lit";export const FlowNodeStyle=t`
2
- :host{
3
- white-space: nowrap;
4
- min-width: 80px;
5
- min-height: 80px;
6
- background: rgba(200,200,200, 0.85);
7
-
8
- display: grid;
9
- grid-template-columns: auto auto auto;
10
- grid-template-rows: auto 1fr;
11
- grid-template-areas:
12
- "title title title"
13
- "input internal output";
14
-
15
- position: absolute;
16
- border-radius: var(--roundness);
17
- transform-origin: 0 0;
18
- z-index: 0;
19
- }
20
- :host([minimal]){
21
- min-width: 60px;
22
- min-height: 60px;
23
- grid-template-columns: var(--socket-display-size) 1fr var(--socket-display-size);
24
- grid-template-rows: auto;
25
- grid-template-areas:
26
- "input title output";
27
- }
28
- .socket-side{
29
- display: flex;
30
- flex-direction: column;
31
- justify-content: center;
32
- justify-content: space-evenly;
33
- }
34
- .inputs{
35
- grid-area: input;
36
- align-items: flex-start;
37
- }
38
- .inputs flow-node-socket{
39
- transform: translateX(calc(var(--socket-size) / -2));
40
- }
41
- .outputs{
42
- grid-area: output;
43
- align-items: flex-end;
44
- }
45
- .outputs flow-node-socket{
46
- transform: translateX(calc(var(--socket-size) / 2));
47
- }
48
- .title{
49
- grid-area: title;
50
- padding: 3px 6px 3px 6px;
51
- background: rgb(180,180,180);
52
- border-radius: inherit;
53
- border-bottom-left-radius: 0;
54
- border-bottom-right-radius: 0;
55
- color: white;
56
- cursor: grab;
57
- }
58
- .title.input{
59
- background: var(--input-color);
60
- text-align: right;
61
- }
62
- .title.processor{
63
- background: var(--processor-color);
64
- text-align: center;
65
- }
66
- .title.output{
67
- background: var(--output-color);
68
- text-align: left;
69
- }
70
- .title.minimal{
71
- background: transparent;
72
- font-size: 20px;
73
- line-height: 50%;
74
- display: table;
75
- padding: 15px 0 15px 0;
76
- text-align: center;
77
- margin-top: auto;
78
- margin-bottom: auto;
79
- }
80
- .title.minimal[singlechar]{
81
- font-size: 32px;
82
- }
83
- .lock-icon{
84
- position: absolute;
85
- top: 0px;
86
- right: 0px;
87
- color: rgba(255,255,255,0.8);
88
- transform: scale(.7);
89
- }
90
- .lock-icon.input{
91
- left: 0;
92
- }
93
- `;
1
+ import { css } from "lit";
2
+ export const FlowNodeStyle = css `
3
+ :host{
4
+ white-space: nowrap;
5
+ min-width: 80px;
6
+ min-height: 80px;
7
+ background: rgba(200,200,200, 0.85);
8
+
9
+ display: grid;
10
+ grid-template-columns: auto auto auto;
11
+ grid-template-rows: auto 1fr;
12
+ grid-template-areas:
13
+ "title title title"
14
+ "input internal output";
15
+
16
+ position: absolute;
17
+ border-radius: var(--roundness);
18
+ transform-origin: 0 0;
19
+ z-index: 0;
20
+ }
21
+ :host([minimal]){
22
+ min-width: 60px;
23
+ min-height: 60px;
24
+ grid-template-columns: var(--socket-display-size) 1fr var(--socket-display-size);
25
+ grid-template-rows: auto;
26
+ grid-template-areas:
27
+ "input title output";
28
+ }
29
+ .socket-side{
30
+ display: flex;
31
+ flex-direction: column;
32
+ justify-content: center;
33
+ justify-content: space-evenly;
34
+ }
35
+ .inputs{
36
+ grid-area: input;
37
+ align-items: flex-start;
38
+ }
39
+ .inputs flow-node-socket{
40
+ transform: translateX(calc(var(--socket-size) / -2));
41
+ }
42
+ .outputs{
43
+ grid-area: output;
44
+ align-items: flex-end;
45
+ }
46
+ .outputs flow-node-socket{
47
+ transform: translateX(calc(var(--socket-size) / 2));
48
+ }
49
+ .title{
50
+ grid-area: title;
51
+ padding: 3px 6px 3px 6px;
52
+ background: rgb(180,180,180);
53
+ border-radius: inherit;
54
+ border-bottom-left-radius: 0;
55
+ border-bottom-right-radius: 0;
56
+ color: white;
57
+ cursor: grab;
58
+ }
59
+ .title.input{
60
+ background: var(--input-color);
61
+ text-align: right;
62
+ }
63
+ .title.processor{
64
+ background: var(--processor-color);
65
+ text-align: center;
66
+ }
67
+ .title.output{
68
+ background: var(--output-color);
69
+ text-align: left;
70
+ }
71
+ .title.minimal{
72
+ background: transparent;
73
+ font-size: 20px;
74
+ line-height: 50%;
75
+ display: table;
76
+ padding: 15px 0 15px 0;
77
+ text-align: center;
78
+ margin-top: auto;
79
+ margin-bottom: auto;
80
+ }
81
+ .title.minimal[singlechar]{
82
+ font-size: 32px;
83
+ }
84
+ .lock-icon{
85
+ position: absolute;
86
+ top: 0px;
87
+ right: 0px;
88
+ color: rgba(255,255,255,0.8);
89
+ transform: scale(.7);
90
+ }
91
+ .lock-icon.input{
92
+ left: 0;
93
+ }
94
+ `;
95
+ //# sourceMappingURL=flow-node-style.js.map
@@ -1,29 +1,31 @@
1
- import{css as t}from"lit";export const PickerStyle=t`
2
- input{
3
- border: 0;
4
- height: max-content;
5
- }
6
- textarea {
7
- min-width: 150px;
8
- min-height: 37px;
9
- }
10
- input[type=number] {
11
- padding: 11px 10px;
12
- }
13
- textarea, input[type=text], select{
14
- font-family: inherit;
15
- padding: 10px;
16
- border-radius: var(--roundness);
17
- width: fit-content;
18
- border: none;
19
- }
20
- .attribute-label{
21
- padding: 5px;
22
- background: rgba(0,0,0,0.05);
23
- text-align: center;
24
- border-radius: var(--roundness);
25
- font-size: 110%;
26
- color: rgb(76, 76, 76);
27
- font-weight: 400;
28
- }
29
- `;
1
+ import { css } from "lit";
2
+ export const PickerStyle = css `
3
+ input{
4
+ border: 0;
5
+ height: max-content;
6
+ }
7
+ textarea {
8
+ min-width: 150px;
9
+ min-height: 37px;
10
+ }
11
+ input[type=number] {
12
+ padding: 11px 10px;
13
+ }
14
+ textarea, input[type=text], select{
15
+ font-family: inherit;
16
+ padding: 10px;
17
+ border-radius: var(--roundness);
18
+ width: fit-content;
19
+ border: none;
20
+ }
21
+ .attribute-label{
22
+ padding: 5px;
23
+ background: rgba(0,0,0,0.05);
24
+ text-align: center;
25
+ border-radius: var(--roundness);
26
+ font-size: 110%;
27
+ color: rgb(76, 76, 76);
28
+ font-weight: 400;
29
+ }
30
+ `;
31
+ //# sourceMappingURL=picker-styles.js.map