@zoneflow/renderer-dom 0.0.1 → 0.0.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 GROOBEE
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -2,12 +2,6 @@ export const DEFAULT_PATH_NODE_WIDTH = 120;
2
2
  export const DEFAULT_PATH_NODE_HEIGHT = 32;
3
3
  export const DEFAULT_PATH_NODE_OFFSET_X = 32;
4
4
  export const DEFAULT_PATH_NODE_GAP_Y = 40;
5
- function typedEntries(record) {
6
- return Object.entries(record);
7
- }
8
- function typedValues(record) {
9
- return Object.values(record);
10
- }
11
5
  function rectFromLayout(layout) {
12
6
  return {
13
7
  x: layout.x,
@@ -62,7 +56,9 @@ function resolveLayout(model, layoutModel) {
62
56
  zoneCache.set(zoneId, worldPos);
63
57
  return worldPos;
64
58
  }
65
- for (const [typedZoneId, layout] of typedEntries(layoutModel.zoneLayoutsById)) {
59
+ const zoneLayoutIds = Object.keys(layoutModel.zoneLayoutsById);
60
+ for (const typedZoneId of zoneLayoutIds) {
61
+ const layout = layoutModel.zoneLayoutsById[typedZoneId];
66
62
  const worldPos = resolveZonePosition(typedZoneId);
67
63
  const anchors = layout.anchors;
68
64
  const resolvedAnchors = {
@@ -88,7 +84,9 @@ function resolveLayout(model, layoutModel) {
88
84
  anchors: resolvedAnchors,
89
85
  };
90
86
  }
91
- for (const [pathId, pathLayout] of typedEntries(layoutModel.pathLayoutsById)) {
87
+ const pathLayoutIds = Object.keys(layoutModel.pathLayoutsById);
88
+ for (const pathId of pathLayoutIds) {
89
+ const pathLayout = layoutModel.pathLayoutsById[pathId];
92
90
  resolvedPathLayouts[pathId] = {
93
91
  ...pathLayout,
94
92
  };
@@ -133,7 +131,9 @@ function resolvePathNodeAnchors(rect) {
133
131
  function createZoneVisualNodes(params) {
134
132
  const { model, layoutModel } = params;
135
133
  const result = {};
136
- for (const [typedZoneId, zone] of typedEntries(model.zonesById)) {
134
+ const zoneIds = Object.keys(model.zonesById);
135
+ for (const typedZoneId of zoneIds) {
136
+ const zone = model.zonesById[typedZoneId];
137
137
  const zoneLayout = layoutModel.zoneLayoutsById[typedZoneId];
138
138
  if (!zoneLayout)
139
139
  continue;
@@ -150,7 +150,9 @@ function createZoneVisualNodes(params) {
150
150
  function createPathVisualNodes(params) {
151
151
  const { model, layoutModel, zonesById } = params;
152
152
  const result = {};
153
- for (const zone of typedValues(model.zonesById)) {
153
+ const zoneIds = Object.keys(model.zonesById);
154
+ for (const zoneId of zoneIds) {
155
+ const zone = model.zonesById[zoneId];
154
156
  const sourceZoneVisual = zonesById[zone.id];
155
157
  if (!sourceZoneVisual)
156
158
  continue;
@@ -187,7 +189,9 @@ function createPathVisualNodes(params) {
187
189
  function createEdgeVisuals(params) {
188
190
  const { model, zonesById, pathsById } = params;
189
191
  const result = {};
190
- for (const zone of typedValues(model.zonesById)) {
192
+ const zoneIds = Object.keys(model.zonesById);
193
+ for (const zoneId of zoneIds) {
194
+ const zone = model.zonesById[zoneId];
191
195
  const sourceZoneVisual = zonesById[zone.id];
192
196
  if (!sourceZoneVisual)
193
197
  continue;
package/package.json CHANGED
@@ -1,23 +1,25 @@
1
1
  {
2
2
  "name": "@zoneflow/renderer-dom",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git@github-groobee:groobee/zoneflow.git",
9
+ "url": "https://github.com/groobee/zoneflow.git",
10
10
  "directory": "packages/renderer-dom"
11
11
  },
12
12
  "publishConfig": {
13
13
  "registry": "https://registry.npmjs.org"
14
14
  },
15
- "files": ["dist"],
15
+ "files": [
16
+ "dist"
17
+ ],
16
18
  "dependencies": {
17
- "@zoneflow/core": "workspace:*"
19
+ "@zoneflow/core": "0.0.2"
18
20
  },
19
21
  "scripts": {
20
22
  "build": "tsc -p tsconfig.json",
21
23
  "type-check": "tsc -p tsconfig.json --noEmit"
22
24
  }
23
- }
25
+ }