{"version":3,"file":"NodeGraphWeb.js","names":[],"sources":["esm/react-flow/NodeGraphWeb.js"],"sourcesContent":["import \"@xyflow/react/dist/style.css\";\n\nimport { isTouchSurface, useResolvedKnobs } from \"@multiplatform.one/theme\";\nimport {\n  useCallback,\n  useEffect,\n  useImperativeHandle,\n  useMemo,\n  useRef,\n  useState\n} from \"react\";\nimport { graphEdgeTypes } from \"../edges/GraphEdge\";\nimport {\n  applySnapToChanges,\n  createSnapSession,\n  snapContextOptions\n} from \"../interaction/snapChanges\";\nimport { useLassoSelect } from \"../interaction/useLassoSelect\";\nimport { LassoOverlay } from \"./LassoOverlay\";\nimport { SnapGuides } from \"./SnapGuides\";\nimport { ConnectionPuck } from \"./ConnectionPuck\";\nimport { KnobEnvelopeProvider } from \"../knobs/KnobEnvelopeProvider\";\nimport { useKnobEnvelope } from \"../knobs/useKnobEnvelope\";\nimport { portConnectionRadius } from \"../nodes/handleGeometry\";\nimport { defaultOverviewZoom } from \"../nodes/lod\";\nimport { graphNodeSize } from \"../nodes/nodeMeasure\";\nimport { GraphVars, graphRootClassName } from \"../theme/GraphVarsStyle\";\nimport { GraphActionsProvider } from \"./GraphActions\";\nimport { GraphCommandBridge } from \"./GraphCommandBridge\";\nimport { GraphPaintProbe } from \"./GraphPaintProbe\";\nimport { GraphZoomVar } from \"./GraphZoomVar\";\nimport { GraphHostProvider, GraphNodeHost } from \"./GraphNodeHost\";\nimport { defaultGraphNodeType, useGraphController } from \"./useGraphController\";\nimport { ReactFlow, ReactFlowProvider, useReactFlow, useStore } from \"./xy\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nconst graphCanvasDefaults = {\n  onlyRenderVisibleElements: true,\n  fitView: true,\n  /** Below this zoom a node draws in `overview` mode. Design §5. */\n  overviewZoom: defaultOverviewZoom,\n  /**\n   * React Flow's own default is **0.5**, which is ABOVE `overviewZoom`.\n   *\n   * Measured in Chrome on `NodeGraph/Overview` at 500 nodes: the zoom-out\n   * control bottomed out at 0.5, `fitView` clamped there and showed 50 of the\n   * 500 nodes, and the overview mode this milestone builds was unreachable —\n   * not broken, unreachable, which is worse, because every unit spec around it\n   * was green. A level of detail below a floor the user cannot cross is dead\n   * code with a passing test suite.\n   *\n   * `graphCanvasDefaults.minZoom < graphCanvasDefaults.overviewZoom` is\n   * asserted in `lod.spec.tsx`, so the two cannot drift back into that state.\n   */\n  minZoom: 0.05,\n  maxZoom: 2\n};\nfunction FitOnFirstMeasure({ enabled }) {\n  const { fitView } = useReactFlow();\n  const allMeasured = useStore((state) => {\n    let total = 0;\n    let measured = 0;\n    for (const node of state.nodeLookup.values()) {\n      total += 1;\n      if (node.measured?.height) measured += 1;\n    }\n    return total > 0 && total === measured;\n  });\n  const fitted = useRef(false);\n  useEffect(() => {\n    if (!enabled || fitted.current || !allMeasured) return;\n    fitted.current = true;\n    void fitView();\n  }, [enabled, allMeasured, fitView]);\n  return null;\n}\nfunction NodeGraphCanvas(props) {\n  const {\n    schema,\n    document,\n    defaultDocument,\n    onDocumentChange,\n    onConnectionRefused,\n    readOnly = false,\n    knobs,\n    presetName,\n    intent,\n    coarsePointer = isTouchSurface(),\n    interactionMode = \"pan\",\n    onlyRenderVisibleElements = graphCanvasDefaults.onlyRenderVisibleElements,\n    fitView = graphCanvasDefaults.fitView,\n    overviewZoom = graphCanvasDefaults.overviewZoom,\n    snapping,\n    minZoom = graphCanvasDefaults.minZoom,\n    maxZoom = graphCanvasDefaults.maxZoom,\n    nodeTypes,\n    connectionPuck = true,\n    longPressLasso = false,\n    nodeLabel,\n    className,\n    style,\n    children\n  } = props;\n  const rootRef = useRef(null);\n  const graphEventRef = useRef(props.onGraphEvent);\n  graphEventRef.current = props.onGraphEvent;\n  const emit = useCallback((event) => graphEventRef.current?.(event), []);\n  const perfHost = props.renderer ?? \"react-flow-web\";\n  const readBootMsRef = useRef(props.readBootMs);\n  readBootMsRef.current = props.readBootMs;\n  const onPaint = useCallback(\n    () => emit({ t: \"paint\", bootMs: readBootMsRef.current?.() ?? null }),\n    [emit]\n  );\n  const { knobProps } = useResolvedKnobs();\n  const size = graphNodeSize(knobProps.sizeToken);\n  const envelope = useKnobEnvelope({\n    knobs,\n    presetName,\n    intent: intent ?? void 0,\n    pointer: coarsePointer ? \"coarse\" : \"fine\"\n  });\n  const connectionRadius = portConnectionRadius({ size, coarsePointer });\n  const reactFlowApi = useReactFlow();\n  const readMeasuredSizes = useCallback(() => {\n    const sizes = {};\n    for (const node of reactFlowApi.getNodes()) {\n      const width = node.measured?.width;\n      const height = node.measured?.height;\n      if (width && height) sizes[node.id] = { width, height };\n    }\n    return sizes;\n  }, [reactFlowApi]);\n  const controller = useGraphController({\n    schema,\n    document,\n    defaultDocument,\n    onDocumentChange,\n    onConnectionRefused,\n    readOnly,\n    size,\n    coarsePointer,\n    readMeasuredSizes\n  });\n  const setNodeData = useCallback(\n    (id, patch) => {\n      const node = controller.document.nodes.find((candidate) => candidate.id === id);\n      if (!node) return;\n      controller.commit({\n        t: \"setNodeData\",\n        id,\n        data: { ...node.data, ...patch }\n      });\n    },\n    [controller]\n  );\n  const host = useMemo(\n    () => ({\n      schema,\n      overviewZoom,\n      coarsePointer,\n      readOnly,\n      setNodeData\n    }),\n    [schema, overviewZoom, coarsePointer, readOnly, setNodeData]\n  );\n  const snapSession = useRef(createSnapSession());\n  const [guides, setGuides] = useState([]);\n  const snapOptions = snapContextOptions({\n    snapping,\n    animation: envelope.knobs.animation,\n    reducedMotion: envelope.prefersReducedMotion,\n    coarsePointer\n  });\n  const { alignment: snapAlignmentOn, grid: snapGrid, thresholdScreenPx } = snapOptions;\n  const reactFlow = reactFlowApi;\n  const controllerNodesRef = useRef(controller.nodes);\n  controllerNodesRef.current = controller.nodes;\n  const controllerChangeRef = useRef(controller.onNodesChange);\n  controllerChangeRef.current = controller.onNodesChange;\n  const onNodesChange = useCallback(\n    (changes) => {\n      const snapped = applySnapToChanges(changes, {\n        nodes: controllerNodesRef.current,\n        zoom: reactFlow.getZoom(),\n        session: snapSession.current,\n        alignment: snapAlignmentOn,\n        grid: snapGrid,\n        thresholdScreenPx\n      });\n      setGuides(\n        (previous) => previous.length === 0 && snapped.guides.length === 0 ? previous : snapped.guides\n      );\n      controllerChangeRef.current(snapped.changes);\n    },\n    [reactFlow, snapAlignmentOn, snapGrid, thresholdScreenPx]\n  );\n  const longPress = useMemo(\n    () => ({\n      rootRef,\n      enabled: longPressLasso,\n      viewport: {\n        get: () => reactFlowApi.getViewport(),\n        set: (viewport) => {\n          void reactFlowApi.setViewport(viewport, { duration: 0 });\n        }\n      },\n      getNodeRects: () => reactFlowApi.getNodes().map((node) => ({\n        id: node.id,\n        rect: {\n          x: node.position.x,\n          y: node.position.y,\n          width: node.measured?.width ?? node.width ?? 0,\n          height: node.measured?.height ?? node.height ?? 0\n        }\n      })),\n      onSelect: (ids) => {\n        const wanted = new Set(ids);\n        reactFlowApi.setNodes(\n          (nodes) => nodes.map((node) => ({ ...node, selected: wanted.has(node.id) }))\n        );\n        emit({ t: \"lasso\", phase: \"select\", ids, haptic: null });\n        emit({ t: \"selection\", ids });\n      },\n      // A WebView cannot buzz. The shell can, so the canvas asks — a HINT, not\n      // a command: whether a buzz is appropriate is the shell's call.\n      onHaptic: () => emit({ t: \"lasso\", phase: \"arm\", ids: [], haptic: \"selection\" }),\n      onCancel: () => emit({ t: \"lasso\", phase: \"cancel\", ids: [], haptic: null })\n    }),\n    [emit, longPressLasso, reactFlowApi]\n  );\n  const lasso = useLassoSelect({ mode: interactionMode, longPress });\n  const ownSlot = useRef(null);\n  const slot = props.commandSlot ?? ownSlot;\n  const handle = useMemo(\n    () => ({\n      fitView: () => slot.current?.fitView(),\n      relayout: () => slot.current?.relayout(),\n      zoomTo: (zoom) => slot.current?.zoomTo(zoom),\n      centerOn: (nodeId) => slot.current?.centerOn(nodeId),\n      setSelection: (ids) => slot.current?.setSelection(ids),\n      exportViewport: () => slot.current?.exportViewport(),\n      undo: () => slot.current?.undo(),\n      redo: () => slot.current?.redo(),\n      perfStart: (label) => slot.current?.perfStart(label),\n      perfStop: (label) => slot.current?.perfStop(label),\n      perfMark: (label) => slot.current?.perfMark(label),\n      setViewport: (x, y, zoom) => slot.current?.setViewport(x, y, zoom),\n      synthPinch: (scale, steps) => slot.current?.synthPinch(scale, steps)\n    }),\n    [slot]\n  );\n  useImperativeHandle(props.graphRef, () => handle, [handle]);\n  const types = useMemo(\n    () => ({ [defaultGraphNodeType]: GraphNodeHost, ...nodeTypes }),\n    [nodeTypes]\n  );\n  const actions = useMemo(\n    () => ({\n      relayout: controller.relayout,\n      undo: controller.undo,\n      redo: controller.redo,\n      canUndo: controller.canUndo,\n      canRedo: controller.canRedo,\n      layoutRunner: controller.layoutRunner,\n      lastLayoutMs: controller.lastLayoutMs,\n      layoutPending: controller.layoutPending,\n      nodeCount: controller.document.nodes.length\n    }),\n    [\n      controller.relayout,\n      controller.undo,\n      controller.redo,\n      controller.canUndo,\n      controller.canRedo,\n      controller.layoutRunner,\n      controller.lastLayoutMs,\n      controller.layoutPending,\n      controller.document.nodes.length\n    ]\n  );\n  return /* @__PURE__ */ jsxs(\n    \"div\",\n    {\n      ref: rootRef,\n      className: className ? `${graphRootClassName} ${className}` : graphRootClassName,\n      \"data-graph-scheme\": envelope.scheme,\n      style: { width: \"100%\", height: \"100%\", ...style },\n      children: [\n        /* @__PURE__ */ jsx(GraphVars, { vars: envelope.vars, scheme: envelope.scheme, revision: envelope.revision }),\n        /* @__PURE__ */ jsx(KnobEnvelopeProvider, { envelope, children: /* @__PURE__ */ jsx(GraphActionsProvider, { value: actions, children: /* @__PURE__ */ jsx(GraphHostProvider, { value: host, children: /* @__PURE__ */ jsxs(\n          ReactFlow,\n          {\n            nodes: controller.nodes,\n            edges: controller.edges,\n            nodeTypes: types,\n            edgeTypes: graphEdgeTypes,\n            onNodesChange,\n            onEdgesChange: controller.onEdgesChange,\n            onConnect: controller.onConnect,\n            isValidConnection: controller.isValidConnection,\n            connectionRadius,\n            onlyRenderVisibleElements,\n            fitView,\n            minZoom,\n            maxZoom,\n            ...lasso.flowProps,\n            colorMode: envelope.scheme,\n            nodesDraggable: !readOnly,\n            nodesConnectable: !readOnly,\n            elementsSelectable: true,\n            proOptions: { hideAttribution: true },\n            children: [\n              /* @__PURE__ */ jsx(FitOnFirstMeasure, { enabled: fitView }),\n              /* @__PURE__ */ jsx(GraphZoomVar, { rootRef }),\n              /* @__PURE__ */ jsx(GraphPaintProbe, { onPaint }),\n              /* @__PURE__ */ jsx(\n                GraphCommandBridge,\n                {\n                  commands: slot,\n                  culling: onlyRenderVisibleElements,\n                  emit,\n                  host: perfHost,\n                  rootRef,\n                  onMounted: props.onCanvasMounted\n                }\n              ),\n              /* @__PURE__ */ jsx(SnapGuides, { guides, animated: snapOptions.animateGuides }),\n              /* @__PURE__ */ jsx(LassoOverlay, { rect: lasso.marquee }),\n              connectionPuck ? /* @__PURE__ */ jsx(\n                ConnectionPuck,\n                {\n                  document: controller.document,\n                  schema,\n                  nodeLabel\n                }\n              ) : null,\n              children\n            ]\n          }\n        ) }) }) })\n      ]\n    }\n  );\n}\nfunction NodeGraphWeb(props) {\n  return /* @__PURE__ */ jsx(ReactFlowProvider, { children: /* @__PURE__ */ jsx(NodeGraphCanvas, { ...props }) });\n}\nexport {\n  NodeGraphWeb,\n  graphCanvasDefaults\n};\n//# sourceMappingURL=NodeGraphWeb.js.map\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,sBAAsB;CAC1B,2BAA2B;CAC3B,SAAS;;CAET,cAAc;;;;;;;;;;;;;;CAcd,SAAS;CACT,SAAS;AACX;AACA,SAAS,kBAAkB,EAAE,WAAW;CACtC,MAAM,EAAE,YAAY,aAAa;CACjC,MAAM,cAAc,UAAU,UAAU;EACtC,IAAI,QAAQ;EACZ,IAAI,WAAW;EACf,KAAK,MAAM,QAAQ,MAAM,WAAW,OAAO,GAAG;GAC5C,SAAS;GACT,IAAI,KAAK,UAAU,QAAQ,YAAY;EACzC;EACA,OAAO,QAAQ,KAAK,UAAU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