elseware-ui 3.0.10 → 3.0.11

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/index.js CHANGED
@@ -14115,19 +14115,6 @@ var Flag = ({
14115
14115
  );
14116
14116
  };
14117
14117
 
14118
- // src/components/data-display/graphs/layouts/registry.ts
14119
- var registry = /* @__PURE__ */ new Map();
14120
- var registerLayout = (type2, executor) => {
14121
- registry.set(type2, executor);
14122
- };
14123
- var getLayout = (type2) => {
14124
- const layout = registry.get(type2);
14125
- if (!layout) {
14126
- throw new Error(`Layout "${type2}" not registered`);
14127
- }
14128
- return layout;
14129
- };
14130
-
14131
14118
  // node_modules/d3-dispatch/src/dispatch.js
14132
14119
  var noop = { value: () => {
14133
14120
  } };
@@ -17111,6 +17098,45 @@ function createTreeLayout(nodes, edges, width, height) {
17111
17098
  };
17112
17099
  });
17113
17100
  }
17101
+
17102
+ // src/components/data-display/graphs/layouts/registry.ts
17103
+ var registry = /* @__PURE__ */ new Map();
17104
+ var defaultLayoutsRegistered = false;
17105
+ var registerLayout = (type2, executor) => {
17106
+ registry.set(type2, executor);
17107
+ };
17108
+ var registerDefaultLayouts = () => {
17109
+ if (defaultLayoutsRegistered) return;
17110
+ registerLayout("force", ({ nodes, edges, width, height, onTick }) => {
17111
+ const sim = createForceLayout(nodes, edges, width, height);
17112
+ sim.on("tick", () => {
17113
+ onTick?.([...nodes]);
17114
+ });
17115
+ return {
17116
+ type: "simulation",
17117
+ stop: () => sim.stop()
17118
+ };
17119
+ });
17120
+ registerLayout("grid", ({ nodes, width, height, onTick }) => {
17121
+ const result = createGridLayout(nodes, width, height);
17122
+ onTick?.(result);
17123
+ return { type: "static" };
17124
+ });
17125
+ registerLayout("tree", ({ nodes, edges, width, height, onTick }) => {
17126
+ const result = createTreeLayout(nodes, edges, width, height);
17127
+ onTick?.(result);
17128
+ return { type: "static" };
17129
+ });
17130
+ defaultLayoutsRegistered = true;
17131
+ };
17132
+ var getLayout = (type2) => {
17133
+ registerDefaultLayouts();
17134
+ const layout = registry.get(type2);
17135
+ if (!layout) {
17136
+ throw new Error(`Layout "${type2}" not registered`);
17137
+ }
17138
+ return layout;
17139
+ };
17114
17140
  var NODE_SIZE = 48;
17115
17141
  var GraphNode = ({ node: node2, renderCustom }) => {
17116
17142
  if (node2.x === void 0 || node2.y === void 0) return null;